All Questions
Tagged with aws-cloudformation amazon-s3
586
questions
63
votes
4
answers
74k
views
AWS CLI S3: copying file locally using the terminal : fatal error: An error occurred (404) when calling the HeadObject operation
I'm trying to copy files locally from s3 bucket. I can get the list of files on my bucket:
aws s3 ls s3://myBucket/myDirectory/todaysFiles/
But when I try to copy the files locally:
aws s3 cp s3://...
41
votes
3
answers
36k
views
How do you set SSE-S3 or SSE-KMS encryption on S3 buckets using Cloud Formation Template?
I'm trying to use a CloudFormation Template to spin up an S3 Bucket in AWS. One of the requirements for this project is that the bucket be encrypted in place. I've been trying to find a way to set ...
38
votes
5
answers
49k
views
Enable Lambda function to an S3 bucket using cloudformation
We are creating an S3 bucket using a CloudFormation template. I would like to associate (Add an event to S3 bucket) a Lambda function whenever a file is added to the S3 bucket.
How is it possible ...
38
votes
5
answers
43k
views
create folder inside S3 bucket using Cloudformation
I'm able to create an S3 bucket using cloudformation but would like to create a folder inside an S3 bucket..like
<mybucket>--><myfolder>
Please let me know the template to be used to ...
28
votes
5
answers
23k
views
CloudFormation, apply Condition on DependsOn
The task that I need to do is make CDN depend on a S3 bucket. But we want to make it use the existing bucket rather than creating a new one.
Here is the sample code that I am trying:
"Parameters" : {...
26
votes
3
answers
38k
views
How can we use serverless.yml to create an AWS S3 bucket and add a file to it?
I'm wondering if it's possible to leverage serverless.yml to create a bucket and add a specific file to it during the deploy process of serverless-framework.
So far, I've been able to add the S3 ...
22
votes
2
answers
22k
views
Create a Lambda notification in an S3 bucket with CloudFormation
I'm trying to create an S3 trigger for a Lambda function in a CloudFormation Template. The S3 bucket already exists, and the Lambda function is being created.
This says it's not possible to modify ...
21
votes
5
answers
30k
views
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, ...
19
votes
6
answers
17k
views
Serverless: Deplyment error S3 Bucket already exists in stack
I am trying to deploy a serverless project which has s3 bucket creation cloudformation in the serverless.yml file, but the problem is when I tried to deploy, it says the s3 bucket already exists and ...
19
votes
5
answers
37k
views
How to loop through values in a CloudFormation template
I am trying to pass a list of comma separated parameters in an AWS CloudFormation template and create multiple Amazon S3 buckets based on those values.
I have a requirement where I will be passing a ...
19
votes
10
answers
36k
views
Unable to upload artifact None referenced by CodeUri parameter of HelloWorldFunction resource
I'm following this tutorial to learn how to use SAM.
Here's the code I have:
template.yml:
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
...
18
votes
4
answers
42k
views
How to add S3 BucketPolicy with AWS CDK?
I wanna translate this CloudFormation piece into CDK:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: S3BucketImageUploadBuffer
PolicyDocument:
Version: "2012-10-17"
Statement:
...
17
votes
4
answers
20k
views
How can I (securely) download a private S3 asset onto a new EC2 instance with cloudinit?
I'm using CloudFormation to manage a Tomcat webserver stack but am tired of doing raw AMI management for new application versions. I'd like to move in the direction of Chef but don't have the time ...
15
votes
2
answers
5k
views
How to get Elastic Container Repository URI from Cloud Formation?
I'm trying to create an Elastic Container Service (ECS) setup from Cloud Formation.
However I don't want the ECS repository to have the ugly autogenerated URI:
111111111.dkr.ecr.us-east-1.amazonaws....
14
votes
3
answers
9k
views
S3 Creation CloudFormation results in 400 Bad Request
I have this problem when creating S3 bucket using CloudFormation. I get a 400 Bad request. Would appreciate if anyone can help.
aws cloudformation deploy --profile DEV --stack-name testBucket --...
13
votes
1
answer
9k
views
AWS Cloudformation Template - Set Region in S3 Bucket
I'm trying to create an s3 bucket in a specific region (us-west-2).
This doesn't seem possible using Cloudformation Templates.
Any ideas? I have had no luck explicitly naming it using the service-...
12
votes
4
answers
11k
views
How to set semi-random name for S3 bucket using cloud formation
I want to create a cloud formation template that creates an S3 bucket with a human readable name, but which can be run many times automatically.
Below is a bucket with predefined name.
What can I ...
12
votes
2
answers
14k
views
Enable logging S3 via cloudFormation template?
I am trying to create 2 buckets with 2 different policies.
One bucket, VendorsWGLogs, will be the destination for log output.
The other bucket, VendorsWG, will give GetObject, PutObject, and ...
12
votes
2
answers
21k
views
S3 error: Access Denied when deploying CFN template with Nested Stacks
I am trying to launch a CFN templated, Nested Stack. The child stack is in a bucket in the same region as the parent I am trying to launch via CFN console.
I have Administrator Access and am able to ...
12
votes
1
answer
5k
views
AWS Api Gateway proxy resource using Cloudformation?
I'm trying to proxy an S3 bucket configured as a website from an API Gateway endpoint. I configured an endpoint successfully using the console, but I am unable to recreate the configuration using ...
10
votes
3
answers
15k
views
Setting Lifecycle configuration for S3 Buckets in YAML file
I'm trying to set a Life cycle configuration for my S3 buckets to expire after 90 days. However, I'm getting an error saying "Property Status cannot be empty" when pushing my CFT stack.
I ...
10
votes
10
answers
40k
views
Unable to validate the following destination configurations (S3 to SQS)
I am trying to set up a workflow with serverless that creates a new S3 bucket, a new SQS queue and when an object is created in the S3 bucket, puts a messages on the queue and spins up a lambda once ...
9
votes
1
answer
6k
views
How do you associate a IAM Role with an Aurora Cluster using CloudFormation?
Following the instructions found here, I have created the following IAM Role
"DatabaseS3Role": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"...
9
votes
3
answers
10k
views
Incorrect S3 bucket policy is detected for bucket in CloudFormation
I have issues implementing CloudTrail via Cloudformation, with a Incorrect S3 bucket policy is detected for bucket error being thrown when I try to launch the model.
Here is the configuration from ...
8
votes
3
answers
6k
views
Cloudformation S3 bucket principal for Cloudfront
I'm trying to create a Yaml template for cloudfront distribution on S3 bucket.
I'm stuck on how to add principal on BucketPolicy.
I want to know how to replace the XXXXXXXXXXX on CloudFront Origin ...
8
votes
5
answers
16k
views
Cloudformation template to trigger Lambda on S3 event
I want to use Cloudformation to create an S3 bucket that will trigger Lambda function whenever an S3 event occurs such as file creation, file deletion, etc.
From my research, I have my AWS::Lambda::...
8
votes
2
answers
5k
views
Enable object logging on s3 bucket via cloudformation
In AWS S3, you have the ability to visit the console and add 'Object-level logging' to a bucket. You create or select a pre-existing trail and select read and write log types.
Now I am creating ...
8
votes
2
answers
11k
views
AWS: How to update an existing S3 bucket-policy via CloudFormation?
I have an existing S3 bucket my-bucket.
I am writing a new CloudFormation template file which creates some new AWS resource that interacts with my-bucket. Now, my business use-case requires me to add ...
8
votes
2
answers
2k
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 ...
7
votes
2
answers
4k
views
CloudFormation creation of CloudFront distribution with logging bucket
Trying to provision a static website bucket that's distributed by CloudFront.
The following CloudFormation template works if I omit the Logging configuration for the distribution:
{
...
"...
7
votes
2
answers
5k
views
Connecting Athena and S3 in same Cloudformation Stack
From the documentation, AWS::Athena::NamedQuery, it is unclear how to attach Athena to an S3 bucket specified in the same stack.
If I had to guess from the example, I would imagine that you can write ...
7
votes
3
answers
6k
views
How to create S3 and triggered lambda in 2 different cloudformation templates
Can a S3 bucket and triggered Lambda be created in separate CloudFormation templates. I want to keep long running resources stack separate from the likes of Lambda which get updated quite frequently
...
7
votes
1
answer
5k
views
CloudFront can't use S3 Website origin, only REST origin Cloudformation
I'm trying to automate spinning up a CloudFront distribution with S3 origin. I'd like to set the origin to the S3 website URL, e.g. mysite.com.s3-website-us-east-1.amazonaws.com. So, I thought my ...
7
votes
3
answers
9k
views
AWS CDK S3 Bucket Creation Error - Bucket_Name already exisits
I am new to using CloudFormation / CDK and am having trouble figuring out to deploy my stacks without error. Currently I am using the python CDK to create a bucket. This bucket will hold model files ...
7
votes
2
answers
14k
views
Access Denied for bucket logging form Applicationloadbalancer : Please check S3bucket permission
Access Denied for bucket: appdeploy-logbucket-1cca50r865s65.
Please check S3bucket permission (Service: AmazonElasticLoadBalancingV2; Status Code: 400; Error Code:
InvalidConfigurationRequest; ...
7
votes
4
answers
4k
views
AWS Cloudformation | Configure Lambda to Use Latest Version of Code in S3 Bucket
Im using codepipeline, codebuild and cloudformation on AWS.
My flow is:
Push a commit to github, this triggers the codepipeline
Codebuild uploads (zipped) lambda functions to S3 bucket
...
7
votes
1
answer
9k
views
cloudformation error: Received 1 FAILURE signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement
Good day, I am using the AWS quick start for linux-bastion.
On changing the QSS3BucketName and QSS3KeyPrefix to the ones in my account it throws the error
Received 1 FAILURE signal(s) out of 1. ...
6
votes
2
answers
5k
views
CloudFormation KMS Encryption Questions
Given a CloudFormation template that defines:
A KMS Key
A KMS Key Alias
An S3 bucket
If for some reason I need to delete the CloudFormation stack and re-deploy, the deletion retains the KMS Key and ...
6
votes
2
answers
5k
views
CloudFormation template to set S3 bucket default encryption [duplicate]
S3 now supports encryption to be applied by default when individual object PUT requests do not contain a specific encryption header.
How can this be set up as part of bucket creation during ...
6
votes
2
answers
12k
views
Way to access S3 Bucket's name from cloudformation/boto3?
My team wants to create an S3 bucket in a cloudformation template without assigning it a bucket name (to let cloudformation name it itself).
When putting a file into the S3 bucket from my lambda ...
6
votes
2
answers
6k
views
Cloudformation SQS Policy for S3 events
I'm trying to create a policy for an SQS queue which would allow any S3 bucket to send events to the queue. I don't seem to be able to do this for a specific S3 queue because I end up with circular ...
6
votes
2
answers
6k
views
AWS Cloud Formation Elastic Load Balancing Account ID
I'm trying to create a template with cloud formation that sets up a load balancer that writes logs to S3 bucket. Instead of giving full access to everyone (e.g. *), I want to restrict PutObject access ...
6
votes
1
answer
6k
views
How to specify multiple buckets in a bucketpolicy in a cfn template?
The following is an example of setting a bucketpolicy in a cfn template for A bucket.
"mybucketpolicy" : {
"Type" : "AWS::S3::BucketPolicy",
"Properties" :...
6
votes
2
answers
9k
views
AWS S3 signed url - X-Amz-Security-Token expires too early
I am in this situation where I need to have a pre-signed url to live for around a month. And since the signature v4 isn't able to deliver this, I've decided to use the V2 for now.
I have set the ...
6
votes
1
answer
6k
views
Programmatically add multiple event notifications to s3 bucket
I would like to use the below cloudformation template to create multiple event notifications on a single existing S3 bucket. However, even if I specify another "LambdaFunctionConfigurations" ...
6
votes
2
answers
5k
views
Is it possible to add NotificationConfiguration to an existing S3 buckets using CFT?
I am still a newbie with AWS services.
I would like to add a Lambda trigger on an existing S3 bucket using a CloudFormation template (CFT). Is this possible?
The following CFT is attempting to ...
6
votes
3
answers
5k
views
How can I specify a signed S3 URL as template in CloudFormation?
In AWS CloudFormation, you can specify a template by uploading a template file or by specifying a S3 URL to a template. (Specify an Amazon S3 template URL)
If the bucket is public, you can construct ...
6
votes
1
answer
2k
views
How can I access protected S3 files in a CFN script?
I am trying to retrieve a file in my cloudformation script. If I make the file publicly available, then it works fine. If the file is private, then the cfn script fails, but with a 404 error in /var/...
6
votes
2
answers
6k
views
Is it possible to dump a RDS database to S3 using AWS Data Pipeline?
Basically I want to pg_dump my RDS database to S3 using AWS Data Pipeline,
I am not 100% sure if this is possible I got up to the stage where the SqlDataNode wants a selectQuery at which point i am ...
6
votes
2
answers
4k
views
AWS - Moving data from one S3 bucket to another with CloudFormation
I'm trying to create a stack with CloudFormation. The stack needs to take some data files from a central S3 bucket and copy them to it's own "local" bucket.
I've written a lambda function to do this, ...