amazon-cloudformation

How to provision a CloudFront distribution with an ACM Certificate using Cloud Formation

∥☆過路亽.° 提交于 2019-12-03 10:33:55
I am attempting to set a certificate in my CloudFrontDistribution using Cloud Formation. My certificate has been issued via Certificate Manager. It has been approved, and I have validated that the certificate works by manual configuration directly through the CloudFront console. Within my CloudFormation template, I have attempted to use both the Identifier and ARN values associated with the certificate in the IamCertificateId property: "ViewerCertificate" : { "IamCertificateId" : "********", "SslSupportMethod": "sni-only" } But in both cases I receive the following error: The specified SSL

AWS Export configuration as cloudformation template

∥☆過路亽.° 提交于 2019-12-03 09:05:11
问题 I´m using AWS CLI and cloudformation, and I could not find any reference in the documentation. Anybody knows if it´s possible create a cloudformation template from a current configuration. Let´s say that I want to get a cloudformation templates from my current security group configuration. Any idea if it´s possible export that configuration as a template using command line? Regards. 回答1: Based on our experience we found 2 possible ways to translate existing manually deployed (from Web Console

Crontab in AWS CloudFormation Userdata

倖福魔咒の 提交于 2019-12-03 08:46:57
How to set crontab when using AWS CloudFormation Userdata? I am setting (crontab -l ; echo "0 * * * * wget -O - -q http://www.example.com/cron.php") | crontab - But the cron is not setting. Is there a specific format which I should be using? This will work, set this in your template, for your instance: "UserData": { "Fn::Base64": { "Fn::Join": [ "", [ "#!/bin/bash\n", "echo '0 * * * * wget -O - -q http://www.example.com/cron.php' > /tmp/mycrontab.txt\n", "sudo -u ubuntu bash -c 'crontab /tmp/mycrontab.txt'\n", ] ] } } To do this properly you should do the following inside the bash script:

Dynamic References to Specify Secret Manager Values in AWS Cloudformation

ぃ、小莉子 提交于 2019-12-03 08:36:48
Is there anyway we can pass dynamic references to Secret Manager to AWS Launch Config User Data? Here is the code snippet I tried: "SampleLaunchConfig": { "Type": "AWS::AutoScaling::LaunchConfiguration", "Properties": { "ImageId": { "Fn::FindInMap": [ "AWSRegionArch2AMI", { "Ref": "AWS::Region" }, "AMI" ] }, "UserData": { "Fn::Base64": { "Fn::Join": [ "", [ "#!/bin/bash -xe\n", "yum update -y\n", "useradd -p <<pwd>>{{resolve:secretsmanager:Credentials:SecretString:userName}}\n", "\n" ] ] } } } } Seems error in getting the useradd: invalid user name '{{resolve:secretsmanager:Credentials

create folder inside S3 bucket using Cloudformation

◇◆丶佛笑我妖孽 提交于 2019-12-03 08:32:04
问题 I'm able to create an S3 bucket using cloudformation but would like to create a folder inside an S3 bucket..like <mybucket>--><myfolder> Please let me know the template to be used to create a folder inside a bucket ...both should be created at the sametime... I'm Using AWS lambda as below stackname = 'myStack' client = boto3.client('cloudformation') response = client.create_stack( StackName= (stackname), TemplateURL= 'https://s3.amazonaws.com/<myS3bucket>/<myfolder>/nestedstack.json',

Cannot set a property of cognito userpool client via cloudformation

亡梦爱人 提交于 2019-12-03 08:25:47
I am trying to run congnito via cloudformation and everything works but there is section in cognito as follows: As you see there is section "Enable identity providers" and I can not find where I can set it to my cognito user pool in cloudformation! I tried this attributes but it says not supported. SupportedIdentityProviders Here is my code for user pool client: UserPoolClient: Type: "AWS::Cognito::UserPoolClient" Properties: ClientName: !Sub ${project}-client ExplicitAuthFlows: - ADMIN_NO_SRP_AUTH - USER_PASSWORD_AUTH GenerateSecret: false UserPoolId: !Ref UserPool RefreshTokenValidity: 30

Conditionally create CodePipeline actions based on CloudFormation conditions

故事扮演 提交于 2019-12-03 08:13:42
Enable / disable sections of a CloudFormation for CodePipeline using Conditionals: This creates a manual notification action once staging has been built and passed Runscope tests: - InputArtifacts: [] Name: !Join ["",[!Ref GitHubRepository, "-prd-approval"]] ActionTypeId: Category: Approval Owner: AWS Version: '1' Provider: Manual OutputArtifacts: [] Configuration: NotificationArn: !GetAtt ["SNSApprovalNotification", "Outputs.SNSTopicArn"] ExternalEntityLink: OutputTestUrl RunOrder: 3 How to enable/disable this like other CloudFormation resources with a Condition: . Action steps don't

What to bake into an AWS AMI and what to provision using cloud-init?

不打扰是莪最后的温柔 提交于 2019-12-03 07:28:29
问题 I'm using AWS Cloudformation to setup numerous elements of network infrastructure (VPCs, SecurityGroups, Subnets, Autoscaling groups, etc) for my web application. I want the whole process to be automated. I want click a button and be able to fire up the whole thing. I have successfully created a Cloudformation template that sets up all this network infrastructure. However the EC2 instances are currently launched without any needed software on them. Now I'm trying to figure out how best to get

Increase the root device size in cloudformation autoscaling group

扶醉桌前 提交于 2019-12-03 07:25:58
问题 I am trying to increase the hard disk space on my ebs backed ec2 instance from my cloudformation AutoScaling::LaunchConfiguration. Initially the root device starts with 8GB. I'd like to increase this to 40GB. I am under the impression I can do this based on this documentation. Unfortunately the config below doesn't seem to work. "LaunchConfig" : { "Type": "AWS::AutoScaling::LaunchConfiguration", "Properties": { "BlockDeviceMappings": [{ "DeviceName": "/dev/sda1", "Ebs" : {"VolumeSize": "40"}

Is there a way for cloudformation to query available zones for subnet creation?

瘦欲@ 提交于 2019-12-03 06:28:44
问题 I have a cloudformation script that attempts to create a VPC, with one subnet per AZ. When I run: aws ec2 describe-availablity-zones I get 4 zones returned: "AvailabilityZones": [ { "State": "available", "RegionName": "us-east-1", "Messages": [], "ZoneName": "us-east-1a" }, { "State": "available", "RegionName": "us-east-1", "Messages": [], "ZoneName": "us-east-1b" }, { "State": "available", "RegionName": "us-east-1", "Messages": [], "ZoneName": "us-east-1c" }, { "State": "available",