FAQ Database Discussion Community


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

amazon-web-services,amazon-cloudformation,ami,packer,cloud-init
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...

AWS CloudFormation: How to get subnet list from VPC?

amazon-web-services,amazon-ec2,subnet,amazon-cloudformation,amazon-elasticache
In CloudFormation, I'm creating a VPC, two EC2 instances, and an Elasticache in front of them. In the template, I'm trying to add the elasticache to the vpc. The problem's happening in creating the AWS::Elasticache::SubnetGroup "CacheSubnetGroup" : { "Type" : "AWS::ElastiCache::SubnetGroup", "Properties" : { "Description" : "Subnets available for the...

How to create a LaunchConfiguration using CloudFormation template which creates a config file?

amazon-web-services,autoscaling,amazon-cloudformation,cloudformation
I want to write a LaunchConfiguration for my AWS stack using CloudFormation template. I have written it like below. "LaunchConfiguration": { "Type": "AWS::AutoScaling::LaunchConfiguration", "Metadata" : { "AWS::CloudFormation::Init" : { "files": { "/etc/test.conf": { "content": { "Fn::Join": [ "", [ "user: root\n", "password: password\n" ]]}, "mode": "000400", "user": "root", "group": "root"...

AWS Cloud Formation RDS security group in VPC

amazon-web-services,amazon-cloudformation
I am trying to add ingress rules to a security group for an RDS instance, but when I add them it says The security group 'sg-14820a71' does not exist in default VPC 'vpc-527a8037'. I have explicitly specified the VPC I want the security group in, it should not be using...

AWS Lambda S3 Bucket Notification via CloudFormation

amazon-web-services,amazon-cloudformation,aws-lambda
I'm trying to create a Lambda notification via CloudFormation but getting an error about the ARN format being incorrect. Either my CloudFormation is wrong or it doesn't support the Lambda preview yet. { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "LambdaArn": { "Type": "String", "Default": "arn:aws:lambda:{some-region}:{some-account-id}:function:{some-fn-name}" } }, "Resources": { "EventArchive": { "Type":...

AWS Auto Scaling Launch Configuration Encrypted EBS Cloud Formation Example

encryption,amazon-web-services,amazon-ec2,amazon-cloudformation,amazon-ebs
I am creating cloud formation script, which will have ELB. In Auto Scaling launch configuration, I want to add encrypted EBS volume. Couldn't find an encrypted property withing blockdevicemapping. I need to encrypt volume. How can I attach an encrypted EBS volume to an EC2 instance through auto scaling launch...

How to use cloudformation to create an ecs cluster?

amazon-web-services,amazon-cloudformation,ec2-container-service
I would like to use a cloudformation template to create my ecs cluster instead of spinning it up by hand, but I have yet to find a way. Is this simply not implemented yet, where you can create an ecs cluster as a resource in your cloudformation template, seems a...

Is there a way to do inheritance or code reuse in an AWS CloudFormation template?

amazon-web-services,amazon-cloudformation,aws-code-deploy
I'm building a CloudFormation template that includes an AWS::AutoScaling::LaunchConfiguration and an AWS::AutoScaling::AutoScalingGroup that uses that LaunchConfiguration. For my stack I'm going to need multiple AutoScalingGroups, but I want them in separate security groups. I'm also going to be using CodeDeploy, so my LaunchConfiguration includes the Metadata and UserData properties to...

How to achieve consistency of re-baking an AMI

amazon-web-services,docker,updates,amazon-cloudformation,offlineapps
I am wondering what would be the best approach for baking an AMI. Although it offers a lot of consistency, it is hard to achieve a level of consistency when you need to re-bake your AMI because of a small security update or new package version because more than likely...

I'd like to create CloudFormation stack with resources in multiple regions. Is this possible?

amazon-cloudformation
Is it possible to create a single Amazon CloudFormation stack template that instantiates an AWS::EC2::Instance in ap-southeast-1 and another AWS::EC2::Instance in us-west-2 for example? I suspect not, but I've not yet found a definitive yes/no saying that stacks can't have resources spanning multiple regions....