-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into merge-back/2.42.1
- Loading branch information
Showing
37 changed files
with
5,014 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ploy/test/server/deployment-group.integ.snapshot/aws-cdk-codedeploy-server-dg.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/@aws-cdk/aws-codedeploy/test/server/deployment-group.integ.snapshot/cdk.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"20.0.0"} | ||
{"version":"21.0.0"} |
2 changes: 1 addition & 1 deletion
2
packages/@aws-cdk/aws-codedeploy/test/server/deployment-group.integ.snapshot/integ.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "20.0.0", | ||
"version": "21.0.0", | ||
"testCases": { | ||
"integ.deployment-group": { | ||
"stacks": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
packages/@aws-cdk/aws-ec2/test/integ.vpc-flow-logs-interval.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { PolicyStatement, Effect, ServicePrincipal } from '@aws-cdk/aws-iam'; | ||
import * as s3 from '@aws-cdk/aws-s3'; | ||
import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; | ||
import { IntegTest } from '@aws-cdk/integ-tests'; | ||
import { FlowLog, FlowLogDestination, FlowLogResourceType, Vpc, FlowLogMaxAggregationInterval } from '../lib'; | ||
|
||
const app = new App(); | ||
|
||
|
||
class TestStack extends Stack { | ||
constructor(scope: App, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
const vpc = new Vpc(this, 'VPC'); | ||
|
||
new FlowLog(this, 'FlowLogsCW', { | ||
resourceType: FlowLogResourceType.fromVpc(vpc), | ||
maxAggregationInterval: FlowLogMaxAggregationInterval.TEN_MINUTES, | ||
}); | ||
|
||
vpc.addFlowLog('FlowLogsS3', { | ||
destination: FlowLogDestination.toS3(), | ||
maxAggregationInterval: FlowLogMaxAggregationInterval.ONE_MINUTE, | ||
}); | ||
|
||
const bucket = new s3.Bucket(this, 'Bucket', { | ||
removalPolicy: RemovalPolicy.DESTROY, | ||
autoDeleteObjects: true, | ||
}); | ||
bucket.addToResourcePolicy(new PolicyStatement({ | ||
effect: Effect.ALLOW, | ||
principals: [new ServicePrincipal('delivery.logs.amazonaws.com')], | ||
actions: ['s3:PutObject'], | ||
resources: [bucket.arnForObjects(`AWSLogs/${this.account}/*`)], | ||
conditions: { | ||
StringEquals: { | ||
's3:x-amz-acl': 'bucket-owner-full-control', | ||
'aws:SourceAccount': this.account, | ||
}, | ||
ArnLike: { | ||
'aws:SourceArn': this.formatArn({ | ||
service: 'logs', | ||
resource: '*', | ||
}), | ||
}, | ||
}, | ||
})); | ||
bucket.addToResourcePolicy(new PolicyStatement({ | ||
effect: Effect.ALLOW, | ||
principals: [new ServicePrincipal('delivery.logs.amazonaws.com')], | ||
actions: ['s3:GetBucketAcl', 's3:ListBucket'], | ||
resources: [bucket.bucketArn], | ||
conditions: { | ||
StringEquals: { | ||
'aws:SourceAccount': this.account, | ||
}, | ||
ArnLike: { | ||
'aws:SourceArn': this.formatArn({ | ||
service: 'logs', | ||
resource: '*', | ||
}), | ||
}, | ||
}, | ||
})); | ||
|
||
vpc.addFlowLog('FlowLogsS3KeyPrefix', { | ||
destination: FlowLogDestination.toS3(bucket, 'prefix/'), | ||
}); | ||
} | ||
} | ||
|
||
|
||
new IntegTest(app, 'FlowLogs', { | ||
testCases: [ | ||
new TestStack(app, 'FlowLogsTestStack'), | ||
], | ||
}); | ||
|
||
app.synth(); |
19 changes: 19 additions & 0 deletions
19
...vpc-flow-logs-interval.integ.snapshot/FlowLogsDefaultTestDeployAssert6AFD1854.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "21.0.0", | ||
"files": { | ||
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { | ||
"source": { | ||
"path": "FlowLogsDefaultTestDeployAssert6AFD1854.template.json", | ||
"packaging": "file" | ||
}, | ||
"destinations": { | ||
"current_account-current_region": { | ||
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", | ||
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" | ||
} | ||
} | ||
} | ||
}, | ||
"dockerImages": {} | ||
} |
Oops, something went wrong.