-
Notifications
You must be signed in to change notification settings - Fork 4k
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 bump-cfnspec-main/v93.0.0
- Loading branch information
Showing
118 changed files
with
2,223 additions
and
347 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
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
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
55 changes: 55 additions & 0 deletions
55
packages/@aws-cdk/aws-codeguruprofiler/test/integ.profiler-group-import-functions.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,55 @@ | ||
import { AccountRootPrincipal, Role } from '@aws-cdk/aws-iam'; | ||
import { App, CfnOutput, Stack } from '@aws-cdk/core'; | ||
import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests'; | ||
import { ProfilingGroup } from '../lib'; | ||
|
||
const app = new App(); | ||
|
||
const stack = new Stack(app, 'ProfilingGroupTestStack'); | ||
|
||
const profilingGroup1 = new ProfilingGroup(stack, 'ProfilingGroupWithExplicitlySetName', { | ||
profilingGroupName: 'ExplicitlySetName', | ||
}); | ||
const profilingGroup2 = new ProfilingGroup(stack, 'ProfilingGroupWithImplicitlySetName'); | ||
|
||
const publishAppRole = new Role(stack, 'PublishAppRole', { | ||
assumedBy: new AccountRootPrincipal(), | ||
}); | ||
profilingGroup1.grantPublish(publishAppRole); | ||
profilingGroup2.grantPublish(publishAppRole); | ||
|
||
const importedGroupWithExplicitlySetName = ProfilingGroup.fromProfilingGroupName( | ||
stack, | ||
'ImportedProfilingGroupWithExplicitlySetName', | ||
profilingGroup1.profilingGroupName, | ||
); | ||
|
||
const importedGroupWithImplicitlySetName = ProfilingGroup.fromProfilingGroupName( | ||
stack, | ||
'ImportedProfilingGroupWithImplicitlySetName', | ||
profilingGroup2.profilingGroupName, | ||
); | ||
|
||
new CfnOutput(stack, 'ExplicitlySetProfilingGroupName', { | ||
value: importedGroupWithExplicitlySetName.profilingGroupName, | ||
}); | ||
|
||
new CfnOutput(stack, 'ImplicitlySetProfilingGroupName', { | ||
value: importedGroupWithImplicitlySetName.profilingGroupName, | ||
}); | ||
|
||
const testCase = new IntegTest(app, 'test', { | ||
testCases: [stack], | ||
}); | ||
|
||
const describe = testCase.assertions.awsApiCall('CloudFormation', 'describeStacks', { | ||
StackName: 'ProfilingGroupTestStack', | ||
}); | ||
|
||
describe.assertAtPath('Stacks.0.Outputs.0.OutputKey', ExpectedResult.stringLikeRegexp('ExplicitlySetProfilingGroupName')); | ||
describe.assertAtPath('Stacks.0.Outputs.0.OutputValue', ExpectedResult.stringLikeRegexp('ExplicitlySetName')); | ||
|
||
describe.assertAtPath('Stacks.0.Outputs.1.OutputKey', ExpectedResult.stringLikeRegexp('ImplicitlySetProfilingGroupName')); | ||
describe.assertAtPath('Stacks.0.Outputs.1.OutputValue', ExpectedResult.stringLikeRegexp('ProfilingGroupTestStackProfilingGroupWithImplicitlySetName98463923')); | ||
|
||
app.synth(); |
19 changes: 19 additions & 0 deletions
19
...r/test/profiler-group-import-functions.integ.snapshot/ProfilingGroupTestStack.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": { | ||
"49d6a3151509f39124c2f82b21cf55a8a1364289fce8b6f8b764af6e204c6647": { | ||
"source": { | ||
"path": "ProfilingGroupTestStack.template.json", | ||
"packaging": "file" | ||
}, | ||
"destinations": { | ||
"current_account-current_region": { | ||
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", | ||
"objectKey": "49d6a3151509f39124c2f82b21cf55a8a1364289fce8b6f8b764af6e204c6647.json", | ||
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" | ||
} | ||
} | ||
} | ||
}, | ||
"dockerImages": {} | ||
} |
131 changes: 131 additions & 0 deletions
131
...test/profiler-group-import-functions.integ.snapshot/ProfilingGroupTestStack.template.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,131 @@ | ||
{ | ||
"Resources": { | ||
"ProfilingGroupWithExplicitlySetNameProfilingGroup20552EAE": { | ||
"Type": "AWS::CodeGuruProfiler::ProfilingGroup", | ||
"Properties": { | ||
"ProfilingGroupName": "ExplicitlySetName" | ||
} | ||
}, | ||
"ProfilingGroupWithImplicitlySetNameProfilingGroup21CDF1FC": { | ||
"Type": "AWS::CodeGuruProfiler::ProfilingGroup", | ||
"Properties": { | ||
"ProfilingGroupName": "ProfilingGroupTestStackProfilingGroupWithImplicitlySetName98463923" | ||
} | ||
}, | ||
"PublishAppRole9FEBD682": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":iam::", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":root" | ||
] | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"PublishAppRoleDefaultPolicyCA1E15C3": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"codeguru-profiler:ConfigureAgent", | ||
"codeguru-profiler:PostAgentProfile" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
{ | ||
"Fn::GetAtt": [ | ||
"ProfilingGroupWithExplicitlySetNameProfilingGroup20552EAE", | ||
"Arn" | ||
] | ||
}, | ||
{ | ||
"Fn::GetAtt": [ | ||
"ProfilingGroupWithImplicitlySetNameProfilingGroup21CDF1FC", | ||
"Arn" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "PublishAppRoleDefaultPolicyCA1E15C3", | ||
"Roles": [ | ||
{ | ||
"Ref": "PublishAppRole9FEBD682" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"ExplicitlySetProfilingGroupName": { | ||
"Value": { | ||
"Ref": "ProfilingGroupWithExplicitlySetNameProfilingGroup20552EAE" | ||
} | ||
}, | ||
"ImplicitlySetProfilingGroupName": { | ||
"Value": { | ||
"Ref": "ProfilingGroupWithImplicitlySetNameProfilingGroup21CDF1FC" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.