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
34
votes
1 answer

using CloudFormation with an existing S3 bucket

Using CloudFormation, I want to set some of the properties in AWS::S3::Bucket on an existing bucket. In other words, I don't want to create the bucket, I just want to enforce some of the settings. Here's an example of my CloudFormation JSON: …
tedder42
  • 833
  • 1
  • 9
  • 19
32
votes
5 answers

AWS CloudFormation - Custom variables in templates

Is there any way to define shortcuts for often-used values derived from CloudFormation template parameters? For example - I've got a script that creates a Multi-AZ Project stack with ELB name project and two instances behind the ELB called project-1…
MLu
  • 23,798
  • 5
  • 54
  • 81
32
votes
3 answers

How can I reuse existing resources in CloudFormation?

I have an S3 bucket as a resource in my CloudFormation template, with DeletionPolicy set to Retain. This works as expected: when deleting the stack, it does indeed retain the bucket. However, when I attempt to create the stack again, creation fails…
vartec
  • 6,137
  • 2
  • 32
  • 49
24
votes
3 answers

AWS CloudFormation: VPC default security group

I have a cfn stack that (among other things), creates a VPC, several security groups, and a handful of EC2 instances. It's trivial to assign security groups that are created within the stack to instances that are also created by the stack. However,…
EEAA
  • 108,414
  • 18
  • 172
  • 242
21
votes
2 answers

Aws vpc default route table in CloudFormation

Am I missing something but is there no way to add a route via CloudFormation to the default route table that comes provisioned with a VPC?
20
votes
3 answers

Is it possible to force Re-creation of EC2::Instance or RDS::DBInstance in amazon cloudformation?

It's possible to force the re-creation of a EC2 or RDS instance using cloudformation stacks? My stack goes stuck in a point where simply destroying and creating the resource will fix it, instead of that I had to delete entire stack to continue…
theist
  • 1,199
  • 2
  • 9
  • 24
16
votes
5 answers

in cloudformation is it possible to create a reusable string?

i have a string the is formed from a number of variables which i use for many different things such as Tags and host names. is there a way of creating a reusable string that i can just Ref though out the template? any thoughts on this would be…
Graeme
  • 660
  • 1
  • 5
  • 16
15
votes
2 answers

How to upload a file into S3 bucket using CloudFormation script?

How do I upload a file into my AWS S3 bucket CloudFormation template? AWSTemplateFormatVersion: '2010-09-09' Resources: S3Bucket: Type: AWS::S3::Bucket Properties: AccessControl: PublicRead BucketName: s3bucketuser …
Ayushi Garg
  • 153
  • 1
  • 1
  • 4
14
votes
2 answers

How do I get AWS CloudFormation to recreate a resource I manually deleted?

I'm experimenting with CloudFormation right now. I deployed a stack that included an AutoScalingGroup (and LaunchConfig and CloudFormation::Init), LoadBalancer, a single EC2 instance (and CloudFormation::Init), and a couple security groups. If I…
gregmac
  • 1,459
  • 3
  • 18
  • 27
14
votes
4 answers

Why doesn't the aws cloud formation install the packages that I specify?

I'm very new to the AWS services. I'm trying to use the AWS cloud formation and I created a template. The template is error free and I am able to create machines using that. But I have added some config in the template such that it installs tomcat,…
batman
  • 321
  • 1
  • 5
  • 10
13
votes
2 answers

Can FindInMap return a list?

I'm using CloudFormation to deploy an ELB to a pre-existing VPC which has pre-existing Subnets. I've listed the subnets in a Mappings section of the template and select the mapping based on the Environment parameter. This works fine if the Mapping…
user3188040
  • 297
  • 1
  • 3
  • 8
13
votes
1 answer

How do I setup Route 53 to point to Api Gateway

I'm writing a Cloudformation config file to create a website all in one go. This includes, creating lambda functions, creating the API Gateway, Setting up a S3 Bucket, Creating the Route 53 zone and records. So far: Creating Lambda functions and…
13
votes
4 answers

AWS CloudFormation returning "Invalid request" when trying to create a AWS::Route53::RecordSet

I'm at a loss on this one. 99% of the time CloudFormation is pretty good at giving you some kind of debug message you can work with, but "Invalid request" has left me stumped, especially when the resource is pretty simple to begin with. This is said…
12
votes
4 answers

Referring to an existing resource in CF Template

We have multiple CloudFormation scripts to create our stack. Now, we want to write (automate) new scripts which will be used just to updated 1 specific resource (business requirement). The thing which i am stuck at is how to refer to an existing…
Em Ae
  • 221
  • 1
  • 2
  • 3
12
votes
3 answers

AWS Cloudformation and manual changes

I can't seem to find any documentation about what happens when you manually mess with Cloudformation's objects. I see it tags its objects, but does it recover if, say, someone deletes a routing rule? EDIT: Just got two contradicting answers. I'd…
Nitz
  • 1,018
  • 1
  • 8
  • 18
1
2 3
17 18