logo
down
shadow

Cloudformation Bucket Policy - "Statement is missing required element"


Cloudformation Bucket Policy - "Statement is missing required element"

By : Olivier Cantin
Date : November 21 2020, 03:00 PM
I wish this helpful for you It has two problems:
Missing AWSTemplateFormatVersion on the first line (the required element) Reference to S3Bucket that should be ReportsBucket
code :
AWSTemplateFormatVersion: 2010-09-09
Resources:
  ReportsBucket:
    Type: AWS::S3::Bucket

  BucketPolicy:
    Type: AWS::S3::BucketPolicy
    Properties:
      Bucket: !Ref ReportsBucket
      PolicyDocument:
        Id: ReportPolicy
        Version: "2012-10-17"
        Statement:
          - Sid: ReportBucketPolicyDoc
            Effect: Allow
            Action: "s3:*"
            Principal:
              AWS: !Join ['', ["arn:aws:iam::", !Ref "AWS::AccountId", ":root"]]
            Resource: !Join ['', ['arn:aws:s3:::', !Ref ReportsBucket, '/*']]


Share : facebook icon twitter icon
"missing required :bucket option" for Paperclip/S3

"missing required :bucket option" for Paperclip/S3


By : Yasen Grozev
Date : March 29 2020, 07:55 AM
wish helps you I think that's because :bucket should be an option passed to Paperclip not to S3.
Fixed config
code :
  config.paperclip_defaults = {
    :storage => :s3,
    :s3_protocol => 'http',
    :bucket => ENV['AWS_BUCKET'],
    :s3_credentials => {
      :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
      :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
    }
  }
Paperclip::Attachment.default_options.merge!(
  :storage => :fog,
  :fog_credentials => {
    :provider => 'AWS',
    :aws_access_key_id => ENV['S3_ACCESS_KEY_ID'],
    :aws_secret_access_key => ENV['S3_SECRET_ACCESS_KEY'],
    :region => 'eu-west-1' # in case you need it
  },
  :fog_directory => ENV['S3_BUCKET'], # only one of those is needed but I don't remember which
  :bucket => ENV['S3_BUCKET']
)
Rails "missing required :bucket option" w/ AWS S3 + Paperclip -- image upload works on Heroku but not locally

Rails "missing required :bucket option" w/ AWS S3 + Paperclip -- image upload works on Heroku but not locally


By : Satish Rajput
Date : March 29 2020, 07:55 AM
this one helps. Case matters with ENV Vars: ENV['s3_bucket'] (from your env.rb files) is not the same as the ENV['S3_BUCKET'] call elsewhere.
On Heroku, you can run heroku config -a your_app_name | grep bucket to confirm that it is indeed uppercased on Heroku. (Assuming you're on a *nix machine).
CloudFormation CloudTrail S3 Policy Error - Incorrect S3 bucket policy is detected for bucket

CloudFormation CloudTrail S3 Policy Error - Incorrect S3 bucket policy is detected for bucket


By : Vishu
Date : March 29 2020, 07:55 AM
may help you . To fix this the resource needed to be joined up to the bucket using a reference
code :
                    "Resource": [{
                      "Fn::Join": [ "", [
                          "arn:aws:s3:::", {
                            "Ref": "s3traillogs"
                          }, "/AWSLogs/XXXXXXXXXXX/*"
                        ]
                      ]
                    }],
CloudFormation Bucket Policy- Missing required field "Effect"

CloudFormation Bucket Policy- Missing required field "Effect"


By : Paulo Guilherme Pilo
Date : March 29 2020, 07:55 AM
hop of those help? Your problem is that the S3NotificationBucketPolicy Policy Document has an extra Version and Statement:
code :
"S3NotificationBucketPolicy": {
    "Type": "AWS::S3::BucketPolicy",
    "Properties": {
        "Bucket": {
            "Ref": "S3NotificationBucket"
        },
        "PolicyDocument": {
            "Version": "2012-10-17",      <-- Here
            "Statement": [{
                "Version": "2012-10-17",  <-- And here
                "Statement": [{
                    "Sid": "AWSCloudTrailAclCheck20150318",
Amazon S3 bucket policy to set "Content Type" to "application/pdf" for a specific folder in a bucket

Amazon S3 bucket policy to set "Content Type" to "application/pdf" for a specific folder in a bucket


By : user2066301
Date : March 29 2020, 07:55 AM
I wish this helpful for you What you want to do can be achieved through setting in the upload phase
I don't think it can be done with a bucket policy
Related Posts Related Posts :
  • Cannot create s3 bucket with event to lamba attached to it in cloudformation
  • Unsupported property *password
  • AWS Get-EC2Tag don`t go without attached EIP
  • Get Facebook access token in AWS Cognito and Lambda
  • AWS S3 costs outside free tier
  • AWS access to resources with cross account and IAC setup
  • Integrating with AWS from our website, services
  • Customizing Notification email on Elastic Beanstalk Environment Health
  • AWS IAM grant user read access to specific VPC only
  • SQL Server Deployment automation with SQL Server Data Tools (SSDT), VSTS and AWS RDS
  • Generate S3 URL in "path-style" format
  • AWS Redshift columnar storage vs distribution style
  • Customizing/Architecting AWS ELB to have Zero Downtime
  • Cloudberry explorer for s3 with AWS session token
  • Integrating Amazon Web services for a new app
  • How do I force a CloudFormation stack to update when the parameter is updated?
  • Cloudwatch - Metrics are expiring
  • Log only errors in AWS Lambda?
  • AWS CloudFront with custom HTTPS origin, only allow origin requests from CF?
  • AWS AMIs: RegisterImage vs CreateImage
  • Questions on AWS Cloudformation Tags and Logical ID's?
  • How to correctly specify path in aws ssm get-parameters-by-path?
  • integration of ntopng on aws centos
  • AWS API Gateway POST request not returning output when sending image as payload
  • AWS Session Manager Raspberry-pi/Beaglebone
  • Can't get LetsEncrypt SSL certificate to work with AWS Lightsail
  • Adding Headers to AWS API Gateway Response using Chalice
  • DynamoDB: Query on columns not present in the Schema
  • NiFi: Is there a way to call AWS Comprehend and connect to NiFi?
  • 'Launch More Like This" will interfere with the running instance in any sense?
  • How to use AWS CLI with Digital Ocean Spaces?
  • Redshift Unload with case-sensitive headers
  • IAM - Purpose of role identity in AWS
  • Issue with filter syntax in AWS tools for Powershell Core
  • AWS SSL configuration using Gandi.net SSL certificate
  • Zeppelin with Athena JDBC
  • AWS Glue Data Catalog, temporary tables and Apache Spark createOrReplaceTempView
  • AWS - Face comparison command line mistake
  • AWS cognito- create new user giving "Unable to parse the number" error
  • How to invoke AWS lambda function using boto (2.49.0) library?
  • AWS deployment group creation fails
  • Use Tags of Stack in CloudFormation
  • Why use SNS to trigger a lambda function, and not API gateway?
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org