Questions tagged [aws-cloudformation-custom-resource]

custom resources allow you to write CFN templates for functionality that is not yet supported natively by AWS. It's useful for new feature releases without Cloudformation support, third party tools, or generally to run lambda functions

See official documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html

238 questions
28
votes
4 answers

CloudFormation Cross-Region Reference

When you are running multiple CloudFormation stacks within the same region, you are able to share references across stacks using CloudFormation Outputs However, outputs cannot be used for cross region references as that documentation…
21
votes
2 answers

How you Reference the function ARN of a Function (Lambda) in serverless.yml file?

Considering this lambda function on a serverless.yml file: functions: s3toEc2Lambda: handler: s3toec2lambda.S3toEc2Lambda name: "${self:service}-s3toEc2Lambda" role: S3toEc2LambdaRole And considering this SNS created on resources…
20
votes
5 answers

AWS Cloudformation- How to do string Uppercase or lowercase in json/yaml template

I am working on AWS CloudFormation and I created one template in which I asked user to select Environment. On the basis of selected value I created the resources. User have to select between DEV, QA, PROD, UAT etc. but when I suffix this value to…
14
votes
1 answer

AWS CDK: Is there a way to create database schema using CDK?

I have created a RDS Aurora Postgres Database Cluster and Database Instance through CDK (using java as a language). Now I am trying to achieve creating a database schema through CDK. I tried but did not find any documentation or help anywhere which…
11
votes
2 answers

Change the Default TimeOut of AWS Custom Resource

Can we change the default timeout of AWS CustomResource, as its default timeout is 1 hour and the job that will return an HTTP response to the custom resource is taking approximately 2 hours to send the response and the custom resource is getting…
9
votes
5 answers

CloudWatch resource access policy error while creating Amazon Elasticsearch Service via Cloud Formation

I am trying to create an elastic search domain with enabled LogPublishingOptions. While enabling LogPublishingOptions ES says it does not sufficient permissions to create a LogStream on Cloudwatch. I tried creating a policy with a role and attaching…
6
votes
1 answer

Delete AWS Cloud formation stack with resources created by it

Based on this page I can do: aws cloudformation delete-stack \ --stack-name my-stack It says I can attach the command: [--retain-resources ] Does that mean that if I don't specify that line, all the resources created by the stack will be…
6
votes
2 answers

How can I reference an existing role in my new CloudFormation template?

In my AWS account, I am building a new Cloudformation template that creates new policies, and I want to attach those to a few existing roles in the account. Here is how I have been trying to reference them: { "AWSTemplateFormatVersion":…
5
votes
2 answers

How to Attach Elastic IP to NatGateway via Cloud Formation

I am trying to learn Aws cloud Formation , where I am trying to create VPC as shown in picture. it contains three public subnets, private subnets , natgateway and Internetgateway with public and private Route table.I am trying to achieve it through…
5
votes
4 answers

Can we dynamically create Keypair through AWS Cloudformation and copy the .PEM file to EC2 Linux instance

My requirement is to create an EC2 instance which will have the Keypair created dynamically from the same Cloudformation template.As of now,I am creating the KeyPair from AWS console and assigning it to EC2 instance through Cloudformation by taking…
4
votes
3 answers

The runtime parameter of nodejs12.x is no longer supported for creating or updating AWS Lambda functions while using AwsCustomResource

In our project we are using AwsCustomResource: const sdkCall: customResource.AwsSdkCall = { service: 'KMS', action: 'replicateKey', physicalResourceId: cr.PhysicalResourceId.of('CustomResource::KeyReplicaCreation'), …
4
votes
0 answers

AWS CloudFormation Stack Fails to Update Lambda Function

Whenever I make an update to my existing Cloud Formation Stack Configuration (within YAML template) and make a deploy then I get following error: MyLambdaFunctionNameAliaslive failed to update One solution is I delete my existing cloud formation…
4
votes
1 answer

How to add a lifecycle policy to an existing S3 bucket in AWS CDK Typescript

I have imported an S3 bucket using below const importbucket = s3.Bucket.fromBucketAttributes(this, 'ImportedBucket', { bucketArn: 'arn:aws:s3:::BUCKETNAME' }); now I am trying to add lifecycle rule, if the bucket is created in the stack I know we…
4
votes
1 answer

Terraform AWS Security group self reference

I am using terraform for AWS resource provisioning. I need to self reference "mySG". from Terraform documentation i can use ingress { from_port = 0 to_port = 0 protocol = -1 self = true } but how…
4
votes
2 answers

Cloud Formation to add multiple S3 triggers to same S3 bucket in LambdaConfigurations

My requirement is to trigger Lambda_Function_1 if input.txt file creates in S3 bucket and trigger Lambda_Function_2 if output.txt file creates in same S3 bucket. The below cfn is not working, but it works fine if I put only one event instead of two…
1
2 3
15 16