Skip to content
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

feat(cloudwatch): dashboard variables #26285

Merged
merged 27 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f95e757
feat(cloudwatch): introduce dashboard variables
Stacy-D Jul 7, 2023
8228942
Merge branch 'main' into dashboard_vars
humanzz Jul 7, 2023
96e5b2e
chore: update README
Stacy-D Jul 8, 2023
5591be2
chore: apply suggestions
Stacy-D Jul 8, 2023
d94c526
chore(cloudwatch): fix formatting
Stacy-D Jul 8, 2023
946d61a
chore(cloudwatch): update README and unit tests
Stacy-D Jul 8, 2023
6aebdbc
chore(cloudwatch): update variables integ tests
Stacy-D Jul 8, 2023
378577c
reformat
humanzz Jul 10, 2023
8282f84
Merge branch 'main' into dashboard_vars
humanzz Jul 10, 2023
44593a2
Apply suggestions from code review
kaizencc Jul 10, 2023
6e6bdb5
address comments, add validations, refactor and rename
humanzz Jul 11, 2023
cf4b749
Merge branch 'main' into dashboard_vars
humanzz Jul 11, 2023
c9fcbef
Merge branch 'main' into dashboard_vars
humanzz Jul 11, 2023
516a5e4
empty commit to force build
humanzz Jul 11, 2023
4213942
renames
humanzz Jul 11, 2023
f6bc1c2
Update packages/aws-cdk-lib/aws-cloudwatch/README.md
kaizencc Jul 11, 2023
d8cc14a
introduce SearchValues and DefaultValue
humanzz Jul 11, 2023
3fd2721
Merge branch 'dashboard_vars' of https://github.com/Stacy-D/aws-cdk i…
humanzz Jul 11, 2023
bcd91be
update docs
humanzz Jul 11, 2023
6469ac3
Merge branch 'main' into dashboard_vars
humanzz Jul 11, 2023
84ac9ae
set DefaultValue.FIRST to be readonly
humanzz Jul 11, 2023
1871a19
Merge branch 'dashboard_vars' of https://github.com/Stacy-D/aws-cdk i…
humanzz Jul 11, 2023
8d1d235
drop ValueDashboardVariable and SearchDashboardVariable
humanzz Jul 11, 2023
0042dd1
Apply suggestions from code review
kaizencc Jul 11, 2023
d8a9389
address comments
humanzz Jul 11, 2023
ba9dbbc
readme
kaizencc Jul 11, 2023
7912c6d
Merge branch 'main' into dashboard_vars
mergify[bot] Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "32.0.0",
"files": {
"b633bcb492f09d5f22533ce8a0e06c6db179f3774bf3675afc4df8b1dccaa645": {
"source": {
"path": "DashboardVariablesIntegrationTest.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "b633bcb492f09d5f22533ce8a0e06c6db179f3774bf3675afc4df8b1dccaa645.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"Resources": {
"DashCCD7F836": {
"Type": "AWS::CloudWatch::Dashboard",
"Properties": {
"DashboardBody": {
"Fn::Join": [
"",
[
"{\"widgets\":[{\"type\":\"text\",\"width\":6,\"height\":2,\"x\":0,\"y\":0,\"properties\":{\"markdown\":\"The dashboard is showing RegionPlaceholder region\",\"background\":\"transparent\"}},{\"type\":\"metric\",\"width\":6,\"height\":6,\"x\":0,\"y\":2,\"properties\":{\"view\":\"timeSeries\",\"title\":\"My fancy graph\",\"region\":\"",
{
"Ref": "AWS::Region"
},
"\",\"metrics\":[[\"AWS/S3\",\"BucketSizeBytes\",\"BucketName\",\"my-bucket\",\"StorageType\",\"StandardStorage\",{\"label\":\"[BucketName: ${PROP('Dim.BucketName')}] BucketSizeBytes\",\"stat\":\"Maximum\"}]],\"yAxis\":{}}}],\"variables\":[{\"pattern\":\"RegionPlaceholder\",\"type\":\"pattern\",\"inputType\":\"radio\",\"id\":\"region3\",\"defaultValue\":\"us-east-1\",\"visible\":true,\"label\":\"RegionPatternWithValues\",\"values\":[{\"label\":\"IAD\",\"value\":\"us-east-1\"},{\"label\":\"DUB\",\"value\":\"us-west-2\"}]},{\"property\":\"BucketName\",\"type\":\"property\",\"inputType\":\"select\",\"id\":\"BucketName\",\"defaultValue\":\"__FIRST\",\"visible\":true,\"label\":\"BucketName\",\"search\":\"{AWS/S3,BucketName,StorageType} MetricName=\\\"BucketSizeBytes\\\"\",\"populateFrom\":\"BucketName\"}]}"
]
]
}
}
}
},
"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."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"32.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "32.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E.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": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "32.0.0",
"testCases": {
"cdk-integ-dashboard-with-variables/DefaultTest": {
"stacks": [
"DashboardVariablesIntegrationTest"
],
"assertionStack": "cdk-integ-dashboard-with-variables/DefaultTest/DeployAssert",
"assertionStackName": "cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"version": "32.0.0",
"artifacts": {
"DashboardVariablesIntegrationTest.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "DashboardVariablesIntegrationTest.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"DashboardVariablesIntegrationTest": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "DashboardVariablesIntegrationTest.template.json",
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b633bcb492f09d5f22533ce8a0e06c6db179f3774bf3675afc4df8b1dccaa645.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"DashboardVariablesIntegrationTest.assets"
],
"lookupRole": {
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"dependencies": [
"DashboardVariablesIntegrationTest.assets"
],
"metadata": {
"/DashboardVariablesIntegrationTest/Dash/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "DashCCD7F836"
}
],
"/DashboardVariablesIntegrationTest/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/DashboardVariablesIntegrationTest/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "DashboardVariablesIntegrationTest"
},
"cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E.template.json",
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E.assets"
],
"lookupRole": {
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"dependencies": [
"cdkintegdashboardwithvariablesDefaultTestDeployAssertE08F481E.assets"
],
"metadata": {
"/cdk-integ-dashboard-with-variables/DefaultTest/DeployAssert/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/cdk-integ-dashboard-with-variables/DefaultTest/DeployAssert/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "cdk-integ-dashboard-with-variables/DefaultTest/DeployAssert"
},
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
}
}
}
Loading