question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python docs are incoreect for aws_s3.CfnBucket "logging_configuration"

See original GitHub issue

Hi,

I’m trying to set the S3 Access Logging using the aws_s3.CfnBucket resource.

Based on the documentation found here and here, I’m adding the value { "DestinationBucketName" : "MyLoggingBucket", "LogFilePrefix" : "logging-"} to the logging_configuration parameter.

The problem is that when I generate the CloudFormation Template, I see always an empty LoggingConfiguration property, as the example below:

Resources:
  bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my_bucket
      LoggingConfiguration: {}
    Metadata:
      aws:cdk:path: logging/bucket
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      Modules: aws-cdk=1.15.0,@aws-cdk/assets=1.15.0,@aws-cdk/aws-cloudwatch=1.15.0,@aws-cdk/aws-ec2=1.15.0,@aws-cdk/aws-events=1.15.0,@aws-cdk/aws-iam=1.15.0,@aws-cdk/aws-kms=1.15.0,@aws-cdk/aws-lambda=1.15.0,@aws
-cdk/aws-logs=1.15.0,@aws-cdk/aws-s3=1.15.0,@aws-cdk/aws-s3-assets=1.15.0,@aws-cdk/aws-s3-notifications=1.15.0,@aws-cdk/aws-sns=1.15.0,@aws-cdk/aws-sqs=1.15.0,@aws-cdk/aws-ssm=1.15.0,@aws-cdk/core=1.15.0,@aws-cdk/c
x-api=1.15.0,@aws-cdk/region-info=1.15.0,jsii-runtime=Python/3.7.5

I think this is a bug (at least in Python) that blocks me into getting further case.

Reproduction Steps

Create a new Stack using Python and add the following code snippet there:

bucket = s3.CfnBucket(
    self, "bucket",
    bucket_name="my_bucket",
    logging_configuration={
        "DestinationBucketName": "MyLoggingBucket",
        "LogFilePrefix": "logging-",
    }
)

Then run cdk synth to see the generated CloudFormation Template.

Error Log

N/A

Environment

  • CLI Version : 1.15.0
  • Framework Version: 1.15.0
  • OS : MacOS X Mojave
  • Language : Python/3.7.5

Other


This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
eduardohkicommented, Dec 4, 2019

Thanks for your reply @RomainMuller

I understand about the limitation in the Python implementation, and my wish is to use CfnBucket.LoggingConfigurationProperty (I did so).

The issue here IMO is the lack of this proper information in the Python Docs, as you stated.

0reactions
RomainMullercommented, Jan 7, 2020

@eduardohki absolutely!

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-s3.CfnBucket - AWS Documentation - Amazon.com
No information is available for this page.
Read more >
aws-cdk/custom-resources module - AWS Documentation
Implemented in Python. Customizing Provider Function name. In multi-account environments or when the custom resource may be re-utilized across several stacks ...
Read more >
class Stack (construct) · AWS CDK
Splits the provided ARN into its components. Works both if 'arn' is a string like 'arn:aws:s3:::bucket', and a Token representing a dynamic CloudFormation ......
Read more >
aws-cdk/pipelines module - AWS Documentation - Amazon.com
You can use a zip file in S3 as the source of the pipeline. The pipeline will be triggered every time the file...
Read more >
Working with the AWS Cloud Development Kit and AWS ...
The AWS CDK allows developers to define their infrastructure in familiar programming languages such as TypeScript, Python, C# or Java, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found