Questions tagged [amazon-cloudformation]

0

votes
1

answer
61

Views

Why does AWS Lambda CFN S3-response returns 403 upon Delete event?

I'm using serverless to deploy an application where I use a Custom Resource to migrate a RDS database. Everything works while I deploy, but when I delete the stack the Custom Resource timeouts after an hour with the message "Custom Resource failed to stabilize in expected time.". The request to the...
kontrollanten
1

votes
0

answer
11

Views

How to create a lambda permission for a custom websocket request authorizer with CloudFormation for API Gateway?

I've been trying to create a lambda permission for a websockets request authorizer for API Gateway and the $connect route. The AWS documenation mentions nothing about creating the proper lambda permission for a websocket authorizer. I keep getting a 500 error when I try to connect to my custom autho...
Thomas Jaeger
1

votes
2

answer
2k

Views

Crontab in AWS CloudFormation Userdata

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?
unnik
1

votes
1

answer
42

Views

Error creating a skill with Cloudformation

i have a month developing alexa skills and want to create then via Cloudformation. And for that i am using this: Lambda function { "AWSTemplateFormatVersion": "2010-09-09", "Description": "Lambda Function from Cloud Formation by Felix Vazquez", "Resources": { "Lambda1": { "Type": "AWS::Lambda::Funct...
bhalgalix
0

votes
0

answer
4

Views

How nested lists works or append to a list in Cloudformation?

I want to refer the security that is getting created in the stack itself. I am trying this but nothing gets worked. Can someone help me out. Parameters: env: Default: qa Type: String Here are the mappings Mappings: envMap: qa: securityGroups: 'sg-xxxxxxxx,sg-xxxxxxxx' sub: subnets: 'subnet-xxxxxxxx...
Nandeep
0

votes
0

answer
4

Views

I want to design a cloudformation template for an existing application

Here I have three seperate dependant applications A,B ,C and D. MySQL db, A has two instances, B has 3 instances and C has 1 and D has 8. All these are connected to Terracota MAX server. Can you please help me in designing a cloudformation template.
Mohammed Fayis P
0

votes
0

answer
6

Views

Subnet problem in VPC creation via cloudformation

I am a noob in networking. I am creating VPC via cloudformation. In that, I have to add 4 subnets. When I run that template it is giving me this error. Template error: Fn::Select cannot select nonexistent value at index 3 But, when I try to create with 3 subnets it gets created. My Template sample:...
ImPurshu
1

votes
1

answer
2.4k

Views

How to get resource logical id cloudformation template?

Is it possible to get a resource's logical ID inside itself like we do with "Ref" : "logicalName". I just want to get the resource logical id (here Instance1) in its own properties section dynamically. Till now i have to hard code resource name. { "AWSTemplateFormatVersion": "2010-09-09", "Mappings"...
Hardeep Singh
1

votes
1

answer
1.9k

Views

CloudFormation - reference resource as default value for Parameter

I have a parameter "SecretKey" and I want to provide a default value to it (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html) and the default value would be a generated random string. I already have a lambda function to do the generation of the key and...
BPm
1

votes
3

answer
4.8k

Views

Attach policy to a IAM Role

Following cloudformation template gives error on line 9 : { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "Policy to allow send receive message from SQS Queue", "Resources" : { "MyPolicy" : { "Type" : "AWS::IAM::Policy", "Properties" : { "PolicyName" : "CFUsers", "Roles": [ { "arn:aws:i...
Aman Khanna
1

votes
3

answer
4.7k

Views

Passing parameters of type List<AWS::EC2::Subnet::Id> to nested CloudFormation template

I'm trying to nest a CloudFormation template into another by using the AWS::CloudFormation::Stack resource type. The nested template has a parameter of type List. Individually, the nested template runs just fine. But when embedding AWS Console says Encountered unsupported property ELBSubnetList. Cha...
Stephan
1

votes
2

answer
1.5k

Views

AWS Cloudformation Fn::ImportValue inside Fn::GetAtt

Is it possible to use Fn::ImportValue inside Fn::GetAtt. Currently, I'm trying to do the following "ParentId": { "Fn::GetAtt": [ { "Fn::ImportValue": { "Fn::Sub": "${ParentStack}:RestApi" } }, "RootResourceId" ] } But I'm facing an error. "Template error: every Fn::GetAtt object requires two non-em...
Mikhail Matvienko
1

votes
2

answer
921

Views

Serverless Service update Dynamodb table created with DeletionPolicy retain

I'm encountering some problems using Serverless framework, since i accidentally used the same name of a service on another one. An error occurred: tableX - TableX already exists. Let's suppose that i have two "serverless.yml" files, both with the same name of service. One of them (let's call it, "t...
Sergio Flores
1

votes
2

answer
1.8k

Views

AWS CodePipeline error: Cross-account pass role is not allowed

I am trying to create an AWS CodePipeline that deploys the production code to a separate account. The code consists of a lambda function which is setup using a sam template and cloudformation. I have it currently deploying to the same account without error. I added another stage that has a manual ap...
johnnywhoop
1

votes
1

answer
222

Views

Email arn does not belong to your account SES Cloudformation

I'm trying to confirm a user my sending a confirmation email. Cogntio requires the arn for email I set up with SES. Below is my template. When I deploy with serverless I get: An error occurred: UserPool - Email arn does not belong to your account. (Service: AWSCognitoIdentityProvider; Status Code: 4...
ovg
1

votes
1

answer
414

Views

AWS Event Rule doesn't work

I have following CFN event rule, which should kick off MyLambda. When i run this CFN template, I can see the rule is created with correct interval, correct input json and it is ENABLED. But it doesn't kick-off. I don't see any logs being created by my lambda (I am using a print statement). But when...
Em Ae
1

votes
1

answer
553

Views

How to define Resource Policy for CloudWatch Logs with CloudFormation?

When I configure DNS Query Logging with Route53, I can create a resource policy for Route53 to log to my log group. I can confirm this policy with the cli aws logs describe-resource-policies and see something like: { "resourcePolicies": [ { "policyName": "test-logging-policy", "policyDocument": "{\...
Ryan Calhoun
1

votes
1

answer
558

Views

Start cfn-init in Ubuntu instance with cloudformation (yaml)

I try to start the cfn-init with: Fn::Base64: !Sub | #!/bin/bash sudo apt-get -y install python-setuptools mkdir aws-cfn-bootstrap-latest curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1 sudo easy_install...
DenCowboy
1

votes
1

answer
505

Views

AWS CodePipeline best practices with 2 AWS accounts

Currently, my project uses 2 AWS accounts - one is for staging that our clients can rely on for testing and the other one is for production/live. I am trying to set up a CodePipeline for a new serverless application. I was wondering if this set up is proper and if there are ways to improve it. Stagi...
nuclear
1

votes
3

answer
782

Views

How to setup Cloudwatch log for a Lambda created in Cloudformation

After creating a Lambda function in Cloudformation, I would like to be able to setup the Cloudwatch Logs expiration in the same Cloudformation script. eg: MyLambdaRole: Type: AWS::Iam::Role ... Properties: ... Policies: - PolicyName: "myPolicy" PolicyDocument: Version: "2012-10-17" Statement: - Effe...
Efren
1

votes
2

answer
666

Views

Lambda backed custom resource cf template returns 'CREATE_FAILED'

The below lambda function is to associate a SNS topic to the existing directories, followed by a custom resource to invoke the lambda func itself. I see that the lambda creation is successful with the 'Register_event_topic' also completing. However, the stack fails after a while mostly because the '...
CMR H
1

votes
2

answer
1k

Views

Cannot create a publicly accessible DBInstance because customer VPC has no - AWS

When I run my .json file inside cloud formation I get the following error "Cannot create a publicly accessible DBInstance because customer VPC has no internet gateway attached." I deleted my default VPC in AWS then the customer support team recreated it for me but I still get the error. These are th...
Oliver Bayes-Shelton
1

votes
1

answer
298

Views

CloudFormation Custom Resource not finishing deleting

I have setup my custom resource to return immediately on deletes const aws = require('aws-sdk') const util = require('util') exports.handler = (event, context) => { console.log('Event>>>') console.log(JSON.stringify(event)) aws.config.update({ region: event.ResourceProperties.Region }) if (event.Req...
Jiew Meng
1

votes
1

answer
59

Views

Adding [email protected] includebody field in cloudfront using cloudformation template?

I am trying to add [email protected] association in cloudfront using cloudformation. As per aws docs they had only two fields like EventType and LambdaFunctionARN . But i want to add IncludeBody in cloudformation so that my [email protected] will read the body of the request . When i try to add IncludeBody in...
Private
1

votes
4

answer
3.2k

Views

Can I use cloud-init to install and configure chef, but not actually run it?

I have a working CloudFormation template, with user data and cloud-init, connecting and building successfully to a hosted Chef server. I'm using Ubuntu 12.04 on an AWS EC2 stock image. For my own purposes I would like to continue to do this, but 1) Not configure Chef to run as a service, only run on...
Aitch
1

votes
2

answer
1.5k

Views

Deleting CloudFormation VPC stack without disassociating the Elastic IP causes delete to fail

I've got a CloudFormation stack (anonymised version at https://gist.github.com/palfrey/7021931) that creates correctly, but attempting to delete it fails trying to delete the VPCGatewayAttachment, because it complains about the VPC having mapped public addresses. If however, I disassociate the Elast...
palfrey
1

votes
3

answer
3.4k

Views

Can I use AWS CloudFormation with a custom AMI?

I want to use an AMI that have not been created from a snapshot. The AMI was created using a virtual machine and then I used CLI tools to create the instance and the AMI. This instance have installed cloud-init. Could I use this AMI to create instances using cloudformation? Do I need to install mor...
1

votes
3

answer
548

Views

Different AMI based on AWS Region?

Is there any reasons that AWS AMI are different based on the region? For example, if I try to launch an EC2 instance in Frankfurt I Got this AMI: Amazon Linux AMI 2015.03 (HVM), SSD Volume Type - *ami-a8221fb5* While in Oregon: Amazon Linux AMI 2015.03 (HVM), SSD Volume Type - *ami-e7527ed7* Note th...
giò
0

votes
0

answer
5

Views

How to clone CodeCommit repo on EC2 cfn-init?

I try to set up my stack with CloudFormation, and on the start of my EC2 instance I want to clone a repository from CodeCommit. The repository is from an other aws account, so I've set up an user with the right permissions. I tried a lot of different way to clone it, but it failed. The last thing I...
guillaume pacquet
1

votes
2

answer
446

Views

Retrieve public IP of another EC2 instance in Saltstack formula

I'm setting up VPN nodes with Cloudformation and provision them with Saltstack. Let's call them left and right node. When provisioning the left node I need to know the public IP of the right node and vice versa. Is there a way to retrieve the IP of another EC2 instance in Saltstack formula? Both ins...
Domen P
1

votes
2

answer
64

Views

Referencing text after script is called within PS1 Script

Let's take the PowerShell statement below as an example: powershell.exe c:\temp\windowsbroker.ps1 IIS Is it possible to have it scripted within windowsbroker.ps1 to check for that IIS string, and if it's present to do a specific install script? The broker script would be intended to install differen...
Sadadar
1

votes
2

answer
430

Views

How do you make your AWS ELB internal in a AWS Cloudformation template?

I am templating an EB app and several environments. I want to ensure that the ELB is set to be internal, but cant find the reference in the Cloudformation documentation.
hynespm
5

votes
3

answer
86

Views

Deploying lambdas effectively (only deploy those that changed) with Terraform/CloudFormation/Something else

So far, I have been using CloudFormation to deploy my lambdas. I find this process very slow and inefficient tho - eg. it may take minutes but it should have taken just seconds if its just deploying that 1 function? Most functions would not have changed but I believe CloudFormation does not differen...
Jiew Meng
1

votes
1

answer
146

Views

Defining AutoScaling for Aurora DB Cluster in CloudFormation template

I need to add AutoScaling for my AWS Aurora DB Cluster, and I found this nice article about how to do it with the web console. But I couldn't find how to define it using CloudFormation template of the AWS::RDS::DBCluster resource. Can someone direct me on how to define Auto Scaling Policies to my DB...
Praneeth Peiris
2

votes
1

answer
744

Views

AWS Lambda Code in S3 Bucket not updating

I am using cloudformation to create my lambda function with the code in a S3Bucket with versioning enabled. "MYLAMBDA": { "Type": "AWS::Lambda::Function", "Properties": { "FunctionName": { "Fn::Sub": "My-Lambda-${StageName}" }, "Code": { "S3Bucket": { "Fn::Sub": "${S3BucketName}" }, "S3Key": { "Fn:...
Kathir
1

votes
3

answer
1.2k

Views

CodePipeline unable to locate SAM template yaml file

I'm attempting to setup AWS Codepipeline with a Cloudformation SAM stack that deploys to a Lambda and am doing this via the Pipeline console. The pipeline passes the clone from Codecommit process and the build process with Codebuild, however fails on the deploy with Cloudformation. I get the follow...
Brooks
2

votes
1

answer
289

Views

Is there a way to clone a Cloudformation stack in the same region?

I would like to clone a cloudformation stack in the same region. Is this possible today using the Cloudformation console? I have a cloudformation template that takes in a big list of parameters. Many times I want to create an identical stack with just a different stack name. Is there a quick way of...
PrasadK
2

votes
1

answer
60

Views

Fn::ImportValue does not match type {Array}

I faced an issue with using the export and import functionality in CloudFormation. When I tried to import a value which actually is a list (array) I received the following error message "does not match type {Array}". vpc.yaml (snippet) PrivateSubnets: Description: A list of the private subnets Value...
Rajan
26

votes
1

answer
6.9k

Views

PropertyDefinition inconsistent

I have following template that i am using in cloudformation UI to create dynamoDB table. I want to create a table with PrimaryKey as ID and sortKey as Value { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "DB Description", "Resources" : { "TableName" : { "Type" : "AWS::DynamoDB::Table",...
Em Ae
2

votes
2

answer
148

Views

Deploy StepFunctions with CloudFormation, from external definition file

I'm trying to deploy stepfunctions with CloudFormation, and I'd like to reference the actual stepfunction definition from an external file in S3. Here's how the template looks like: StepFunction1: Type: "AWS::StepFunctions::StateMachine" Properties: StateMachineName: !Ref StepFunction1SampleName Ro...
AlinIacob

View additional questions