Skip to content

Commit

Permalink
Merge branch 'main' into awsgh-24918
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 6, 2023
2 parents 60f1d01 + 7ad619d commit 8fe721c
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 61 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.73.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.72.1-alpha.0...v2.73.0-alpha.0) (2023-04-05)

## [2.72.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.72.0-alpha.0...v2.72.1-alpha.0) (2023-03-30)

## [2.72.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.71.0-alpha.0...v2.72.0-alpha.0) (2023-03-29)
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.73.0](https://github.com/aws/aws-cdk/compare/v2.72.1...v2.73.0) (2023-04-05)


### Features

* **cli:** exposed synth's quiet option in cdk.json ([#24793](https://github.com/aws/aws-cdk/issues/24793)) ([8c58b25](https://github.com/aws/aws-cdk/commit/8c58b25dc8b74eabc277c611503a9dbb4c6a57fc)), closes [#24251](https://github.com/aws/aws-cdk/issues/24251)
* **pipelines:** Add ability to define fileSystemLocations for a CodePipeline ([#24584](https://github.com/aws/aws-cdk/issues/24584)) ([55906bb](https://github.com/aws/aws-cdk/commit/55906bbffc01780f380e61f470c091abee4d6835)), closes [#24495](https://github.com/aws/aws-cdk/issues/24495)
* **rds:** Add dbname parameter to RDS.DatabaseSecret construct ([#24729](https://github.com/aws/aws-cdk/issues/24729)) ([b9ce0ee](https://github.com/aws/aws-cdk/commit/b9ce0ee2e65952ff42487f898aaca719babeb4f6)), closes [#24728](https://github.com/aws/aws-cdk/issues/24728)
* **trigger:** Allow trigger to work with Lambda functions with long timeouts ([#24435](https://github.com/aws/aws-cdk/issues/24435)) ([30e05f0](https://github.com/aws/aws-cdk/commit/30e05f0c543fed9964c6d68740ae65336ba0ae23)), closes [#23788](https://github.com/aws/aws-cdk/issues/23788)


### Bug Fixes

* **core:** some trace info is missing from the validation report ([#24889](https://github.com/aws/aws-cdk/issues/24889)) ([5003cad](https://github.com/aws/aws-cdk/commit/5003cadbd89ff5e960fe8eb1c057c40d03bc8198))
* **ec2:** looking up a shared VPC has incorrect account ID in ARN ([#24486](https://github.com/aws/aws-cdk/issues/24486)) ([963634b](https://github.com/aws/aws-cdk/commit/963634b001c10dcc18d78d28d3e05504974bc140)), closes [#23865](https://github.com/aws/aws-cdk/issues/23865)
* **ecr:** policytext errors when includes resource ([#24401](https://github.com/aws/aws-cdk/issues/24401)) ([a9d6966](https://github.com/aws/aws-cdk/commit/a9d6966ffc9b972e3e69d157f3f045d3c4e15827))
* **globalaccelerator:** parameter name can exceed limit of 64 characters ([#24796](https://github.com/aws/aws-cdk/issues/24796)) ([334dc80](https://github.com/aws/aws-cdk/commit/334dc80ffb076ab9d229a7944a2d7d711d1a445f)), closes [#24325](https://github.com/aws/aws-cdk/issues/24325)
* **iam:** roleName not validated in fromRoleName function ([#24549](https://github.com/aws/aws-cdk/issues/24549)) ([637fc6a](https://github.com/aws/aws-cdk/commit/637fc6a8526b6a090c1ffb4b08ca1149fdb9755d)), closes [#24503](https://github.com/aws/aws-cdk/issues/24503)
* **lambda-nodejs:** pnpm installs frozen lockfile in a CI environment ([#24781](https://github.com/aws/aws-cdk/issues/24781)) ([552cef4](https://github.com/aws/aws-cdk/commit/552cef48a7d98cd320150897ebcf1f2867360d56)), closes [/github.com/pnpm/pnpm/issues/1994#issuecomment-609403673](https://github.com/aws//github.com/pnpm/pnpm/issues/1994/issues/issuecomment-609403673)

## [2.72.1](https://github.com/aws/aws-cdk/compare/v2.72.0...v2.72.1) (2023-03-30)

## [2.72.0](https://github.com/aws/aws-cdk/compare/v2.71.0...v2.72.0) (2023-03-29)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export interface IAttributeGroup extends cdk.IResource {
* @param shareOptions The options for the share.
*/
shareAttributeGroup(id: string, shareOptions: ShareOptions): void;

/**
* Associate an application with attribute group
* If the attribute group is already associated, it will ignore duplicate request.
*/
associateWith(application: IApplication): void;
}

/**
Expand Down Expand Up @@ -61,10 +67,6 @@ abstract class AttributeGroupBase extends cdk.Resource implements IAttributeGrou
public abstract readonly attributeGroupId: string;
private readonly associatedApplications: Set<string> = new Set();

/**
* Associate an application with attribute group
* If the attribute group is already associated, it will ignore duplicate request.
*/
public associateWith(application: IApplication): void {
if (!this.associatedApplications.has(application.node.addr)) {
const hashId = this.generateUniqueHash(application.node.addr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ describe('Attribute Group', () => {
expect(attributeGroup.attributeGroupId).toEqual('0aqmvxvgmry0ecc4mjhwypun6i');
}),

test('Associate an application to an imported attribute group', () => {
const attributeGroup = appreg.AttributeGroup.fromAttributeGroupArn(stack, 'MyAttributeGroup',
'arn:aws:servicecatalog:us-east-1:123456789012:/attribute-groups/0aqmvxvgmry0ecc4mjhwypun6i');
const application = new appreg.Application(stack, 'MyApplication', {
applicationName: 'MyTestApplication',
});
attributeGroup.associateWith(application);
Template.fromStack(stack).hasResourceProperties('AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation', {
Application: { 'Fn::GetAtt': ['MyApplication5C63EC1D', 'Id'] },
AttributeGroup: '0aqmvxvgmry0ecc4mjhwypun6i',
});

});

test('fails for attribute group imported by ARN missing attributeGroupId', () => {
expect(() => {
appreg.AttributeGroup.fromAttributeGroupArn(stack, 'MyAttributeGroup',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "31.0.0",
"files": {
"82d95f02f48b1a318e263f9ed8a8bffdeb427088f26115168bac269d7c1d92fb": {
"9dae111f7879c2c97f5b16fbc40629d676f0cf7d329d77da3a5bb25ece0faabd": {
"source": {
"path": "integ-servicecatalogappregistry-attribute-group.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "82d95f02f48b1a318e263f9ed8a8bffdeb427088f26115168bac269d7c1d92fb.json",
"objectKey": "9dae111f7879c2c97f5b16fbc40629d676f0cf7d329d77da3a5bb25ece0faabd.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"Resources": {
"TestApplication2FBC585F": {
"Type": "AWS::ServiceCatalogAppRegistry::Application",
"Properties": {
"Name": "TestApplication",
"Description": "My application description"
}
},
"TestAttributeGroupB1CB284F": {
"Type": "AWS::ServiceCatalogAppRegistry::AttributeGroup",
"Properties": {
Expand All @@ -19,6 +26,23 @@
"Description": "test attribute group description"
}
},
"TestAttributeGroupApplicationAttributeGroupAssociation73d834483ae31BB2BA9A": {
"Type": "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation",
"Properties": {
"Application": {
"Fn::GetAtt": [
"TestApplication2FBC585F",
"Id"
]
},
"AttributeGroup": {
"Fn::GetAtt": [
"TestAttributeGroupB1CB284F",
"Id"
]
}
}
},
"TestAttributeGroupMyShareIdBAA9E628": {
"Type": "AWS::RAM::ResourceShare",
"Properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"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}/82d95f02f48b1a318e263f9ed8a8bffdeb427088f26115168bac269d7c1d92fb.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9dae111f7879c2c97f5b16fbc40629d676f0cf7d329d77da3a5bb25ece0faabd.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand All @@ -33,12 +33,24 @@
"integ-servicecatalogappregistry-attribute-group.assets"
],
"metadata": {
"/integ-servicecatalogappregistry-attribute-group/TestApplication/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "TestApplication2FBC585F"
}
],
"/integ-servicecatalogappregistry-attribute-group/TestAttributeGroup/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "TestAttributeGroupB1CB284F"
}
],
"/integ-servicecatalogappregistry-attribute-group/TestAttributeGroup/ApplicationAttributeGroupAssociation73d834483ae3": [
{
"type": "aws:cdk:logicalId",
"data": "TestAttributeGroupApplicationAttributeGroupAssociation73d834483ae31BB2BA9A"
}
],
"/integ-servicecatalogappregistry-attribute-group/TestAttributeGroup/MyShareId": [
{
"type": "aws:cdk:logicalId",
Expand Down Expand Up @@ -68,15 +80,6 @@
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
],
"TestAttributeGroupRAMSharec67f7d80e5baA10EFB4E": [
{
"type": "aws:cdk:logicalId",
"data": "TestAttributeGroupRAMSharec67f7d80e5baA10EFB4E",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
]
},
"displayName": "integ-servicecatalogappregistry-attribute-group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
"id": "integ-servicecatalogappregistry-attribute-group",
"path": "integ-servicecatalogappregistry-attribute-group",
"children": {
"TestApplication": {
"id": "TestApplication",
"path": "integ-servicecatalogappregistry-attribute-group/TestApplication",
"children": {
"Resource": {
"id": "Resource",
"path": "integ-servicecatalogappregistry-attribute-group/TestApplication/Resource",
"attributes": {
"aws:cdk:cloudformation:type": "AWS::ServiceCatalogAppRegistry::Application",
"aws:cdk:cloudformation:props": {
"name": "TestApplication",
"description": "My application description"
}
},
"constructInfo": {
"fqn": "aws-cdk-lib.aws_servicecatalogappregistry.CfnApplication",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-servicecatalogappregistry-alpha.Application",
"version": "0.0.0"
}
},
"TestAttributeGroup": {
"id": "TestAttributeGroup",
"path": "integ-servicecatalogappregistry-attribute-group/TestAttributeGroup",
Expand Down Expand Up @@ -35,7 +60,32 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-servicecatalogappregistry.CfnAttributeGroup",
"fqn": "aws-cdk-lib.aws_servicecatalogappregistry.CfnAttributeGroup",
"version": "0.0.0"
}
},
"ApplicationAttributeGroupAssociation73d834483ae3": {
"id": "ApplicationAttributeGroupAssociation73d834483ae3",
"path": "integ-servicecatalogappregistry-attribute-group/TestAttributeGroup/ApplicationAttributeGroupAssociation73d834483ae3",
"attributes": {
"aws:cdk:cloudformation:type": "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation",
"aws:cdk:cloudformation:props": {
"application": {
"Fn::GetAtt": [
"TestApplication2FBC585F",
"Id"
]
},
"attributeGroup": {
"Fn::GetAtt": [
"TestAttributeGroupB1CB284F",
"Id"
]
}
}
},
"constructInfo": {
"fqn": "aws-cdk-lib.aws_servicecatalogappregistry.CfnAttributeGroupAssociation",
"version": "0.0.0"
}
},
Expand Down Expand Up @@ -75,13 +125,13 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-ram.CfnResourceShare",
"fqn": "aws-cdk-lib.aws_ram.CfnResourceShare",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-servicecatalogappregistry.AttributeGroup",
"fqn": "@aws-cdk/aws-servicecatalogappregistry-alpha.AttributeGroup",
"version": "0.0.0"
}
},
Expand All @@ -93,7 +143,7 @@
"id": "ImportMyRole",
"path": "integ-servicecatalogappregistry-attribute-group/MyRole/ImportMyRole",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"fqn": "aws-cdk-lib.Resource",
"version": "0.0.0"
}
},
Expand Down Expand Up @@ -133,13 +183,13 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-iam.CfnRole",
"fqn": "aws-cdk-lib.aws_iam.CfnRole",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-iam.Role",
"fqn": "aws-cdk-lib.aws_iam.Role",
"version": "0.0.0"
}
},
Expand All @@ -151,7 +201,7 @@
"id": "ImportMySecondRole",
"path": "integ-servicecatalogappregistry-attribute-group/MySecondRole/ImportMySecondRole",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"fqn": "aws-cdk-lib.Resource",
"version": "0.0.0"
}
},
Expand Down Expand Up @@ -191,35 +241,35 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-iam.CfnRole",
"fqn": "aws-cdk-lib.aws_iam.CfnRole",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-iam.Role",
"fqn": "aws-cdk-lib.aws_iam.Role",
"version": "0.0.0"
}
},
"BootstrapVersion": {
"id": "BootstrapVersion",
"path": "integ-servicecatalogappregistry-attribute-group/BootstrapVersion",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnParameter",
"fqn": "aws-cdk-lib.CfnParameter",
"version": "0.0.0"
}
},
"CheckBootstrapVersion": {
"id": "CheckBootstrapVersion",
"path": "integ-servicecatalogappregistry-attribute-group/CheckBootstrapVersion",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnRule",
"fqn": "aws-cdk-lib.CfnRule",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Stack",
"fqn": "aws-cdk-lib.Stack",
"version": "0.0.0"
}
},
Expand All @@ -233,7 +283,7 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.App",
"fqn": "aws-cdk-lib.App",
"version": "0.0.0"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import * as appreg from '../lib';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'integ-servicecatalogappregistry-attribute-group');

const application = new appreg.Application(stack, 'TestApplication', {
applicationName: 'TestApplication',
description: 'My application description',
});

const attributeGroup = new appreg.AttributeGroup(stack, 'TestAttributeGroup', {
attributeGroupName: 'myFirstAttributeGroup',
description: 'test attribute group description',
Expand All @@ -21,6 +26,9 @@ const attributeGroup = new appreg.AttributeGroup(stack, 'TestAttributeGroup', {
},
},
});

attributeGroup.associateWith(application);

const myRole = new iam.Role(stack, 'MyRole', {
assumedBy: new iam.AccountPrincipal(stack.account),
});
Expand Down
Loading

0 comments on commit 8fe721c

Please sign in to comment.