How to create and verify a cross region public certificate through CloudFormation?

223 Views Asked by At

I'm attempting to achieve the following through CloudFormation.

From a stack created in EU region I want to create (and verify) a public certificate against Route53 in US-EAST-1 due to using Cloudfront. Aiming to have zero actions performed in the console or AWS CLI.

The new CloudFormation support for ACM was a little sketchy last week but seems to be working now.

Certifcate

Resources:

    Certificate:
        Type: AWS::CertificateManager::Certificate
        Properties:
            DomainName: !Sub "${Env}.domain.cloud"
            ValidationMethod: DNS
            DomainValidationOptions:
                -
                    DomainName: !Sub "${Env}.domain.cloud"
                    HostedZoneId: !Ref HostedZoneId

All I need to do is use Cloudformation to deploy this into the US-EAST-1 region from stack in a different region. Everything else is ready for this.

I thought that using Codepipeline's cross region support would be great so I started to look into [this documentation][1] after getting setting things up in my template I met the following error message... An error occurred while validating the artifact bucket {...} The bucket named is not located in the `us-east-1` AWS region.

To me this makes no sense as it seems that you already need at least a couple of resources to exist in target region for it to work. Cart before the horse kind of behavior. To test this I create an artifact bucket in the target region by hand and things worked fine, but requires using CLI or the console when I'm aiming for a CloudFormation based solution.

Note: I'm running out of time to write this so I'll update it when I can in a few hours time. any help before I can do that would be great though

1

There are 1 best solutions below

0
On

Sadly, that's required for cross-region CodePipeline. From docs:

When you create or edit a pipeline, you must have an artifact bucket in the pipeline Region and then you must have one artifact bucket per Region where you plan to execute an action.

If you want to fully automate this through CloudFormation, you either have to use custom resource to create buckets in all the regions in advance or look at stack sets to deploy one template bucket in multiple regions.

p.s.

Your link does not work, thus I'm not sure if you refer to the same documentation page.