Skip to content

Commit 8d0b97b

Browse files
docs(servicecatalogappregistry): update README.md to track latest change (#24855)
This commit updates the `README.md` to be in sync with the latest change. Deprecated methods are removed, new methods are added. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a9bb875 commit 8d0b97b

File tree

1 file changed

+27
-5
lines changed
  • packages/@aws-cdk/aws-servicecatalogappregistry

1 file changed

+27
-5
lines changed

packages/@aws-cdk/aws-servicecatalogappregistry/README.md

+27-5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const importedApplication = appreg.Application.fromApplicationArn(
6161

6262
## Application-Associator
6363

64+
`ApplicationAssociator` defines an AppRegistry application to contain all the stacks in deployed through your cdk package. This helps to manage all the
65+
cdk deployed resources.
66+
67+
### Create a new application to associate all the stacks in the cdk.App scope
68+
6469
If you want to create an Application named `MyAssociatedApplication` in account `123456789012` and region `us-east-1`
6570
and want to associate all stacks in the `App` scope to `MyAssociatedApplication`, then use as shown in the example below:
6671

@@ -100,6 +105,8 @@ const associatedApp = new appreg.ApplicationAssociator(app, 'AssociatedApplicati
100105
});
101106
```
102107

108+
### Import existing application to associate all the stacks in the cdk.App scope
109+
103110
If you want to re-use an existing Application with ARN: `arn:aws:servicecatalog:us-east-1:123456789012:/applications/applicationId`
104111
and want to associate all stacks in the `App` scope to your imported application, then use as shown in the example below:
105112

@@ -113,6 +120,8 @@ const associatedApp = new appreg.ApplicationAssociator(app, 'AssociatedApplicati
113120
});
114121
```
115122

123+
### Associate attribute group to the application used by `ApplicationAssociator`
124+
116125
If you want to associate an Attribute Group with application created by `ApplicationAssociator`, then use as shown in the example below:
117126

118127
```ts
@@ -140,6 +149,8 @@ associatedApp.appRegistryApplication.addAttributeGroup('MyAttributeGroup' , {
140149

141150
```
142151

152+
### Associate stacks deployed by CDK pipelines
153+
143154
If you are using CDK Pipelines to deploy your application, the application stacks will be inside Stages, and
144155
ApplicationAssociator will not be able to find them. Call `associateStage` on each Stage object before adding it to the
145156
Pipeline, as shown in the example below:
@@ -180,6 +191,8 @@ const cdkPipeline = new ApplicationPipelineStack(app, 'CDKApplicationPipelineSta
180191
});
181192
```
182193

194+
### Associate cross-account stack
195+
183196
By default, ApplicationAssociator will not perform cross-account stack associations with the target Application,
184197
to avoid deployment failures for accounts which have not been setup for cross-account associations.
185198
To enable cross-account stack associations, make sure all accounts are in the same organization as the
@@ -198,10 +211,15 @@ const associatedApp = new appreg.ApplicationAssociator(app, 'AssociatedApplicati
198211
});
199212
```
200213

214+
### Associate cross-region stack
215+
216+
Currently, cross-region stack association is not supported.
217+
201218
## Attribute Group
202219

203220
An AppRegistry attribute group acts as a container for user-defined attributes for an application.
204221
Metadata is attached in a machine-readable format to integrate with automated workflows and tools.
222+
The attribute group name must be unique at the account level and it's immutable.
205223

206224
```ts
207225
const attributeGroup = new appreg.AttributeGroup(this, 'MyFirstAttributeGroup', {
@@ -240,14 +258,18 @@ A Cloudformation stack can only be associated with one appregistry application.
240258
If a stack is associated with multiple applications in your app or is already associated with one,
241259
CDK will fail at deploy time.
242260

243-
### Associating application with an attribute group
261+
### Associating application with a new attribute group
244262

245-
You can associate an attribute group with an application with the `associateAttributeGroup()` API:
263+
You can create and associate an attribute group to an application with the `addAttributeGroup()` API:
246264

247265
```ts
248266
declare const application: appreg.Application;
249267
declare const attributeGroup: appreg.AttributeGroup;
250-
application.associateAttributeGroup(attributeGroup);
268+
application.addAttributeGroup('MyAttributeGroupId' , {
269+
attributeGroupName: 'MyAttributeGroupName',
270+
description: 'Test attribute group',
271+
attributes: {},
272+
});
251273
```
252274

253275
### Associating an attribute group with application
@@ -262,14 +284,14 @@ attributeGroup.associateWith(application);
262284

263285
### Associating application with a Stack
264286

265-
You can associate a stack with an application with the `associateStack()` API:
287+
You can associate a stack with an application with the `associateApplicationWithStack()` API:
266288

267289
```ts
268290
const app = new App();
269291
const myStack = new Stack(app, 'MyStack');
270292

271293
declare const application: appreg.Application;
272-
application.associateStack(myStack);
294+
application.associateApplicationWithStack(myStack);
273295
```
274296

275297
## Sharing

0 commit comments

Comments
 (0)