Skip to content

Commit

Permalink
chore(aws-ec2): fix broken integration tests (#19690)
Browse files Browse the repository at this point in the history
Couple of fixes:

- `integ.instance-init`: Create a new VPC instead of performing a lookup
  in order to make the stack env agnostic
- `integ.vpc-endpoint-service`: Moved this test to the
  elasticloadbalancingv2 package since for the test to actually do
  anything it needs to create NLBs.
- `integ.vpc-endpoint-service-cn`: Removed this test since it is the
  same as the above test except for creating it in china
- `integ.vpc-flow-logs`: Added `autoDeleteObjects` so that the stack can
  be deleted. Also added the bucket policy to the bucket to avoid some
  race conditions when the stack tries to delete the bucket while AWS is
  attempting to add this policy to the bucket.
- `integ.vpn-pre-shared-key-token`: The purpose of this test seemed to
  be validating that a token can be used so I changed this to just use
  `Lazy`. Also, that property does not support SSM Secure references.


----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
corymhall authored Apr 1, 2022
1 parent e04b1d7 commit 097fe19
Show file tree
Hide file tree
Showing 11 changed files with 1,540 additions and 226 deletions.
542 changes: 533 additions & 9 deletions packages/@aws-cdk/aws-ec2/test/integ.instance-init.expected.json

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions packages/@aws-cdk/aws-ec2/test/integ.instance-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@ import * as cdk from '@aws-cdk/core';
import * as ec2 from '../lib';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'integ-init', {
env: {
account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION,
},
});
const stack = new cdk.Stack(app, 'integ-init');

const vpc = ec2.Vpc.fromLookup(stack, 'VPC', { isDefault: true });
const vpc = new ec2.Vpc(stack, 'IntegInitVpc');

const tmpDir = fs.mkdtempSync('/tmp/cfn-init-test');
fs.writeFileSync(path.resolve(tmpDir, 'testFile'), 'Hello World!\n');
Expand Down

This file was deleted.

46 changes: 0 additions & 46 deletions packages/@aws-cdk/aws-ec2/test/integ.vpc-endpoint-service-cn.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit 097fe19

Please sign in to comment.