-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(integ-tests-alpha): Account ID not redacted in integration test #30831
Comments
@jdukewich Good afternoon. Please execute the following steps to re-generate the correct snapshots:
import * as cdk from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import { EC2_RESTRICT_DEFAULT_SECURITY_GROUP } from 'aws-cdk-lib/cx-api';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
const app = new cdk.App();
class SgLookupStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
this.node.setContext(EC2_RESTRICT_DEFAULT_SECURITY_GROUP, false);
const testVpc = new ec2.Vpc(this, 'MyVpc', {
vpcName: 'my-vpc-name',
ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
subnetConfiguration: [],
natGateways: 0,
});
new ec2.SecurityGroup(this, 'MySgA', { vpc: testVpc, securityGroupName: 'my-sg' });
}
}
const stack = new SgLookupStack(app, 'StackWithSg');
new IntegTest(app, 'SgLookupTest', {
testCases: [stack],
});
app.synth();
Thanks, |
After you have updated the snapshot, if you run the build again from root, your build should fail. We have a tool |
Looks good removing env, thank you |
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
In snapshots from integration tests, you will notice that any account IDs get redacted and replaced with
${AWS::AccountId}
. However, if you try to write an integration test that creates a security group, it will not remove the account ID from the *.assets.json or manifest.json files.Expected Behavior
I expected my AWS Account ID to be replaced by
${AWS::AccountId}
in the generated snapshot files.Current Behavior
My AWS Account ID is not replaced by
${AWS::AccountId}
in the generated snapshot files.Reproduction Steps
packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.security-group.ts
yarn build && yarn integ --update-on-failed aws-ec2/test/integ.security-group
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.148.1
Framework Version
No response
Node.js Version
v20.11.1
OS
Ubuntu via WSL2
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: