Questions tagged [amazon-cloudformation]

Amazon Web Services CloudFormation is a JSON- or YAML-based templating system that can be used to create and manage a collection of related AWS resources, provisioning and updating them in an orderly and predictable fashion. You can think of it as 'Infrastructure-as-code'.

For more information see:

256 questions
5
votes
2 answers

Cloudformation intrinsic function Fn::Sub mapping

I don't understand why Fn::Sub in this template is not working. I get the following error: Template contains errors.: Template error: One or more Fn::Sub intrinsic functions don't specify expected arguments. Specify a string as first argument, and…
titus
  • 404
  • 6
  • 17
5
votes
3 answers

Is it possible to populate an S3 bucket through a CloudFormation template?

I need to store some files for my CF template (GraphQL schema, Lambda source, etc) into an S3 bucket that will also (hopefully) be defined in the same template, as that seems to be the only way outside of dropping the contents directly into the…
5
votes
1 answer

AWS::CloudFormation::Init not executing commands

I'm trying to get ansible installed on an instance. I figured I could use AWS::CloudFormation::Init to execute sudo pip install ansible. That doesn't seem to be working, though. This is my instance resource: ansibleInstance: Type:…
theillien
  • 425
  • 3
  • 10
  • 26
5
votes
3 answers

how to pull docker image on ECR using cloudformation template

I want to use docker image hosted on ECR and i want to automate the pull operation using cloudformation template. I attached IAM role with ECR full access to ec2 instance and it doesn't work. i am doing docker pull…
5
votes
1 answer

Specifying a VPC in a CloudFormation template for an EC2 instance

I'm launching an EC2 instance via a CloudFormation template, however, the specified instance t2.micro requires a VPC. How do I specify a VPC in the CloudFormation template? Here's my template: { "Description" : "Single Instance", …
Snowcrash
  • 1,087
  • 2
  • 16
  • 19
5
votes
1 answer

Passing parameters to AWS Lambda

I'm trying to write a CloudFormation template that subscribes a Lambda function to a CloudWatch Logs LogGroup. This Lambda function should then parse the logs and put them in to an Amazon ES cluster. The subscription etc. is all working nicely, but…
5
votes
1 answer

Autoscaling health checks fail in Amazon-provided ECS CloudFormation template.

I am attempting to stand up a new ECS cluster using the CloudFormation ECS Service template AWS provided here as a guide. My ECS instances boot within the AutoScaling group, but then fail a health check and are always terminated. The output…
4
votes
1 answer

Adding an existing security group CloudFormation EC2 template

Instead of having to set ingress and egress rules, how do I reference existing EC2 security groups in a CloudFormation Template? Resources: EC2Instance: Type: AWS::EC2::Instance Properties: InstanceType: …
4
votes
1 answer

How to fix / why are Conditions causing Unresolved resource dependencies

Edit Original details below. In the process of chasing this down, I've now narrowed it down to the fact that this security group DatabaseSecurityGroup: Type: AWS::EC2::SecurityGroup Condition: WantsMail Properties: …
philolegein
  • 369
  • 3
  • 9
4
votes
1 answer

Can't modify existing auto-scaling-group in cloud formation

I have created a new template in Cloud Formation and I'm willing in my cloud formation template to add a new target group to an existing auto scaling group that was created manually. What are my possibilities to achieve it?
4
votes
2 answers

Can we register domain in AWS route 53 via cloudformation?

I am new Cloudformation and I am trying to find a Cloudformation script to register the domain, say example.com under Route53. I looked at cloudformation pdf and found nothing related to domain registration under route53. Any pointers/help will be…
4
votes
1 answer

Run EC2 instance into specific non-default VPC in random subnet

I have a problem and I expect that someone help me. I'm working with AWS and I have 2 VPC. The default VPC an another VPC created by me. Each VPC has 3 subnets in differents AZ (eu-west-1a, eu-west-1b and eu-west-1c). I detected that, in default…
4
votes
1 answer

Assigning a public ip to an ec2 in cloudformation?

In the vpc I am using on aws ec2's do not get a public ip address by default. I am trying to add one manually after referencing this and this bit of documentation. Currently my cloudformation template includes "netinterface" : { "Type" :…
4
votes
1 answer

Per-instance alarms inside auto-scaling groups in CloudFormation

Basically what it ways on the tin, how can I create individual per-instance alarms inside an auto-scaling group created with a CloudFormation template? I can reference the ASG itself in an alarm and create ASG-level alarms, but cannot seem to…
Alex B
  • 1,654
  • 2
  • 16
  • 29
4
votes
2 answers

How do I create DNS entries for EC2 instances created by Auto Scaling?

I'm looking into using auto scaling groups for a tier of webservers that would be fronted by an ELB. One of the things I'm having a hard time with is how to give each new instance the proper DNS name. For example, I'd like webservers to have names…
1 2
3
17 18