I have a stack definition for AWS Fargate. Among other things, my stack has a load balancer, and a public IP/DNS for outside access. I made the certificate manually, using Route53 and currently attach it as:
Parameters:
VPC:
Type: AWS::EC2::VPC::Id
SubnetA:
Type: AWS::EC2::Subnet::Id
SubnetB:
Type: AWS::EC2::Subnet::Id
Certificate:
Type: String
# Update with the certificate ARN from Certificate Manager, which must exist in the same region.
# In our case, it is staging-api.mydomain.com
Default: 'arn:aws:acm:us-east-1:505xxxxx303:certificate/03df1a1e-xxxx-xxxx-xxxx-34388b5a1f67'
I would much rather create/update the SSL certificate upon stack creation, instead of having to depend on an external process returning an existing certificate id. In fact, I would rather do away with both my hardcoded AWS account id and the hardcoded certificate id.
Can I get/inherit the account id from the AWS principal somehow and automate the certificate management?