Closed leantorres73 closed 3 years ago
I'm going to guess the source for this is around versions of the cdk project and the constructs
library.
Looks like you're using NPM. Can I see your package.json
?
dev dependencies:
"devDependencies": {
"@aws-cdk/assert": "1.123.0",
"@aws-cdk/aws-appconfig": "1.123.0",
"@aws-cdk/aws-certificatemanager": "1.123.0",
"@aws-cdk/aws-codebuild": "1.123.0",
"@aws-cdk/aws-codepipeline": "1.123.0",
"@aws-cdk/aws-codepipeline-actions": "1.123.0",
"@aws-cdk/aws-codestarnotifications": "1.123.0",
"@aws-cdk/aws-ec2": "1.123.0",
"@aws-cdk/aws-elasticbeanstalk": "1.123.0",
"@aws-cdk/aws-iam": "1.123.0",
"@aws-cdk/aws-route53": "1.123.0",
"@aws-cdk/aws-s3": "1.123.0",
"@aws-cdk/aws-s3-assets": "1.123.0",
"@aws-cdk/aws-secretsmanager": "1.123.0",
"@aws-cdk/aws-ssm": "1.123.0",
"@aws-cdk/core": "1.123.0",
"@aws-cdk/pipelines": "1.123.0",
"aws-cdk": "1.123.0",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.1",
"factory-girl": "^5.0.4",
"fake": "^0.2.2",
"husky": "^6.0.0",
"jest": "^26.6.0",
"nodemon": "1.19.1",
"prettier": "^1.18.2",
"vr-cdk-utils": "1.5.7"
},
and I'm trying to add a tag to the stack
cdk.Tags.of(deploymentStack).add(
'Description',
'Resource Description'
);
The main problem is that if I remove the creation of the S3 bucket from the stack it works, when adding the bucket it does not. The creation of the stack is inside a pipeline stage
Sorry about wasting your time, I found out that I was doing a return in the Stack constructor, that means the constructor was returning something else than expected and that was failing
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Setting a tag in a stack, where the stack creates an S3 bucket is throwing an error:
Digging a little more in the issue, it looks like
this.scope
does not have node, but it has the bucket as a children. So if I console logthis.scope
before it fails I see this:This means it will never find
node
attribute because it's one level down.Reproduction Steps
Create a Stack, then try to add a tag like this:
cdk.Tags.of(deploymentStack).add('tagname', 'tagvalue'
);What did you expect to happen?
It should set a tag for each element inside the stack with no issues
What actually happened?
When the Stack contains an S3 bucket creation, it fails with the error mentioned above
Environment
This is :bug: Bug Report