Skip to content

Unable to bootstrap SES v1 Email Identity without Pro #26

@JonathanAtCenterEdge

Description

@JonathanAtCenterEdge

Given a template yaml

AWSTemplateFormatVersion: 2010-09-09
Resources:
  ExampleEmailIdentity:
    Type: AWS::SES::EmailIdentity
    Properties:
      EmailIdentity: no-reply@example.com

with this Aspire resource

var awsResources = builder.AddAWSCloudFormationTemplate("aws-resources", "app-resources.yaml")
    .WithReference(localstack);

Cloud Formation fails with the following

2026-03-16T14:31:24 Provisioning aws-resources...
2026-03-16T14:31:24 Waiting for resource 'localstack' to enter the 'Running' state.
2026-03-16T14:31:32 Waiting for resource 'localstack' to become healthy.
2026-03-16T14:31:36 Waiting for resource ready to execute for 'localstack'.
2026-03-16T14:31:36 Finished waiting for resource 'localstack'.
2026-03-16T14:31:36 Creating CloudFormation change set.
2026-03-16T14:31:36 ... Waiting for change set to be reviewed
2026-03-16T14:31:39 Executing CloudFormation change set
2026-03-16T14:31:39 Initiated CloudFormation stack creation for aws-resources
2026-03-16T14:31:39 ... Waiting for CloudFormation stack aws-resources to be ready
2026-03-16T14:31:39 --------------------------------------------------------------
2026-03-16T14:31:42 03/16/2026 18:31     aws-resources                            CREATE_IN_PROGRESS                      
2026-03-16T14:31:42 03/16/2026 18:31     ExampleEmailIdentity                     CREATE_IN_PROGRESS                      
2026-03-16T14:31:42 03/16/2026 18:31     ExampleEmailIdentity                     CREATE_FAILED                            Resource provider operation failed: 
2026-03-16T14:31:42 03/16/2026 18:31     aws-resources                            CREATE_FAILED                           
2026-03-16T14:31:42 03/16/2026 18:31     aws-resources                            ROLLBACK_COMPLETE                       
2026-03-16T14:31:42  CloudFormation provisioning failed
2026-03-16T14:31:42  Error provisioning aws-resources
Aspire.Hosting.AWS.Provisioning.AWSProvisioningException: Failed to apply CloudFormation template
   at Aspire.Hosting.AWS.Provisioning.CloudFormationTemplateResourceProvisioner`1.GetOrCreateResourceAsync(T resource, CancellationToken cancellationToken) in C:\build\src\Aspire.Hosting.AWS\Provisioning\CloudFormationTemplateResourceProvisioner.cs:line 60
   at Aspire.Hosting.AWS.Provisioning.AWSResourceProvisioner`1.GetOrCreateResourceAsync(IAWSResource resource, CancellationToken cancellationToken) in C:\build\src\Aspire.Hosting.AWS\Provisioning\AWSResourceProvisionerOfT.cs:line 29
   at Aspire.Hosting.AWS.AWSLifecycleHook.ProvisionAWSResourcesAsync(IList`1 awsResources, ILookup`2 parentChildLookup, CancellationToken cancellationToken) in C:\build\src\Aspire.Hosting.AWS\AWSLifecycleHook.cs:line 131

Upon further research AWS::SES::EmailIdentity is only supported by SESv2, not v1. Using a callback on the Localstack resource works, but something more officially supported would be much cleaner.

    .OnResourceReady(async (resource, _, ct) =>
    {
        var sesConfig = new AmazonSimpleEmailServiceConfig
        {
            ServiceURL = await resource.GetConnectionStringAsync(ct),
            AuthenticationRegion = "us-east-1"
        };

        using var sesClient = new AmazonSimpleEmailServiceClient(
            new BasicAWSCredentials(resource.Options.Session.AwsAccessKeyId, resource.Options.Session.AwsAccessKey),
            sesConfig);

        await sesClient.VerifyEmailIdentityAsync(new VerifyEmailIdentityRequest
        {
            EmailAddress = "no-reply@example.com"
        }, ct);
    });

I attempted to use a BindMount with some shell scripts on the localstack resource, but there isn't any exposure of the underlying container, so it's not possible publicly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions