Skip to content

Commit 5256de7

Browse files
authored
fix(appconfig): turn on awslint and fix linter errors (#27893)
Most issues center around doc strings. I know nothing about appconfig, but I feel like there's massive value added to this module by providing even the cloudformation docs within cdk, so that they are accessible within the IDE. Some other linter rules I've added as exceptions, because I don't have the capacity to audit them, but they should be audited. Issue to track that work: #27894. Labeled as a fix because technically, some public facing code has changed and also I want to make sure this ends up on the changelog. BREAKING CHANGE: `Environment.fromEnvironmentAttributes` function signature changed; property called `attr` is now `attrs`. This should affect only Python users. - **appconfig**: `Extension.fromExtensionAttributes` function signature changed; property called `attr` is now `attrs`. This should affect only Python users. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 412fb9f commit 5256de7

File tree

7 files changed

+255
-37
lines changed

7 files changed

+255
-37
lines changed

packages/@aws-cdk/aws-appconfig-alpha/README.md

+37-14
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ Use AWS AppConfig, a capability of AWS Systems Manager, to create, manage, and q
2222

2323
## Application
2424

25-
In AWS AppConfig, an application is simply an organizational construct like a folder. This organizational construct has a relationship with some unit of executable code. For example, you could create an application called MyMobileApp to organize and manage configuration data for a mobile application installed by your users. Configurations and environments are associated with the application.
25+
In AWS AppConfig, an application is simply an organizational construct like a folder. This organizational construct has a
26+
relationship with some unit of executable code. For example, you could create an application called MyMobileApp to organize and
27+
manage configuration data for a mobile application installed by your users. Configurations and environments are associated with
28+
the application.
2629

2730
The name and description of an application are optional.
2831

@@ -43,7 +46,8 @@ new appconfig.Application(this, 'MyApplication', {
4346

4447
## Deployment Strategy
4548

46-
A deployment strategy defines how a configuration will roll out. The roll out is defined by four parameters: deployment type, step percentage, deployment time, and bake time.
49+
A deployment strategy defines how a configuration will roll out. The roll out is defined by four parameters: deployment type,
50+
step percentage, deployment time, and bake time.
4751
See: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-deployment-strategy.html
4852

4953
Deployment strategy with predefined values:
@@ -68,11 +72,15 @@ new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', {
6872

6973
## Configuration
7074

71-
A configuration is a higher-level construct that can either be a `HostedConfiguration` (stored internally through AWS AppConfig) or a `SourcedConfiguration` (stored in an Amazon S3 bucket, AWS Secrets Manager secrets, Systems Manager (SSM) Parameter Store parameters, SSM documents, or AWS CodePipeline). This construct manages deployments on creation.
75+
A configuration is a higher-level construct that can either be a `HostedConfiguration` (stored internally through AWS
76+
AppConfig) or a `SourcedConfiguration` (stored in an Amazon S3 bucket, AWS Secrets Manager secrets, Systems Manager (SSM)
77+
Parameter Store parameters, SSM documents, or AWS CodePipeline). This construct manages deployments on creation.
7278

7379
### HostedConfiguration
7480

75-
A hosted configuration represents configuration stored in the AWS AppConfig hosted configuration store. A hosted configuration takes in the configuration content and associated AWS AppConfig application. On construction of a hosted configuration, the configuration is deployed.
81+
A hosted configuration represents configuration stored in the AWS AppConfig hosted configuration store. A hosted configuration
82+
takes in the configuration content and associated AWS AppConfig application. On construction of a hosted configuration, the
83+
configuration is deployed.
7684

7785
```ts
7886
declare const application: appconfig.Application;
@@ -108,7 +116,9 @@ new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
108116
});
109117
```
110118

111-
When you create a configuration and configuration profile, you can specify up to two validators. A validator ensures that your configuration data is syntactically and semantically correct. You can create validators in either JSON Schema or as an AWS Lambda function.
119+
When you create a configuration and configuration profile, you can specify up to two validators. A validator ensures that your
120+
configuration data is syntactically and semantically correct. You can create validators in either JSON Schema or as an AWS
121+
Lambda function.
112122
See [About validators](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile.html#appconfig-creating-configuration-and-profile-validators) for more information.
113123

114124
A hosted configuration with validators:
@@ -127,7 +137,8 @@ new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
127137
});
128138
```
129139

130-
You can attach a deployment strategy (as described in the previous section) to your configuration to specify how you want your configuration to roll out.
140+
You can attach a deployment strategy (as described in the previous section) to your configuration to specify how you want your
141+
configuration to roll out.
131142

132143
A hosted configuration with a deployment strategy:
133144

@@ -147,7 +158,8 @@ new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
147158
});
148159
```
149160

150-
The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not specified, there will not be a deployment.
161+
The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not
162+
specified, there will not be a deployment.
151163

152164
A hosted configuration with `deployTo`:
153165

@@ -164,7 +176,10 @@ new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
164176

165177
### SourcedConfiguration
166178

167-
A sourced configuration represents configuration stored in an Amazon S3 bucket, AWS Secrets Manager secret, Systems Manager (SSM) Parameter Store parameter, SSM document, or AWS CodePipeline. A sourced configuration takes in the location source construct and optionally a version number to deploy. On construction of a sourced configuration, the configuration is deployed only if a version number is specified.
179+
A sourced configuration represents configuration stored in an Amazon S3 bucket, AWS Secrets Manager secret, Systems Manager
180+
(SSM) Parameter Store parameter, SSM document, or AWS CodePipeline. A sourced configuration takes in the location source
181+
construct and optionally a version number to deploy. On construction of a sourced configuration, the configuration is deployed
182+
only if a version number is specified.
168183

169184
### S3
170185

@@ -309,7 +324,8 @@ new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
309324
});
310325
```
311326

312-
The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not specified, there will not be a deployment.
327+
The `deployTo` parameter is used to specify which environments to deploy the configuration to. If this parameter is not
328+
specified, there will not be a deployment.
313329

314330
A sourced configuration with `deployTo`:
315331

@@ -327,7 +343,11 @@ new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
327343

328344
## Environment
329345

330-
For each AWS AppConfig application, you define one or more environments. An environment is a logical deployment group of AWS AppConfig targets, such as applications in a Beta or Production environment. You can also define environments for application subcomponents such as the Web, Mobile, and Back-end components for your application. You can configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls back the configuration.
346+
For each AWS AppConfig application, you define one or more environments. An environment is a logical deployment group of AWS
347+
AppConfig targets, such as applications in a Beta or Production environment. You can also define environments for application
348+
subcomponents such as the Web, Mobile, and Back-end components for your application. You can configure Amazon CloudWatch alarms
349+
for each environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system rolls
350+
back the configuration.
331351

332352
Basic environment with monitors:
333353

@@ -343,11 +363,13 @@ new appconfig.Environment(this, 'MyEnvironment', {
343363
});
344364
```
345365

346-
Environment monitors also support L1 CfnEnvironment.MonitorsProperty constructs. However, this is not the recommended approach for CloudWatch alarms because a role will not be auto-generated if not provided.
366+
Environment monitors also support L1 CfnEnvironment.MonitorsProperty constructs. However, this is not the recommended approach
367+
for CloudWatch alarms because a role will not be auto-generated if not provided.
347368

348369
## Extension
349370

350-
An extension augments your ability to inject logic or behavior at different points during the AWS AppConfig workflow of creating or deploying a configuration.
371+
An extension augments your ability to inject logic or behavior at different points during the AWS AppConfig workflow of
372+
creating or deploying a configuration.
351373
See: https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html
352374

353375
### AWS Lambda destination
@@ -438,7 +460,9 @@ new appconfig.Extension(this, 'MyExtension', {
438460
});
439461
```
440462

441-
You can also add extensions and their associations directly by calling `onDeploymentComplete()` or any other action point method on the AWS AppConfig application, configuration, or environment resource. To add an association to an existing extension, you can call `addExtension()` on the resource.
463+
You can also add extensions and their associations directly by calling `onDeploymentComplete()` or any other action point
464+
method on the AWS AppConfig application, configuration, or environment resource. To add an association to an existing
465+
extension, you can call `addExtension()` on the resource.
442466

443467
Adding an association to an AWS AppConfig application:
444468

@@ -450,4 +474,3 @@ declare const lambdaDestination: appconfig.LambdaDestination;
450474
application.addExtension(extension);
451475
application.onDeploymentComplete(lambdaDestination);
452476
```
453-
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
{
22
"exclude": [
3-
"*:*"
3+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ConfigurationSourceType.S3",
4+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ConfigurationSourceType.SSM_DOCUMENT",
5+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ConfigurationSourceType.SSM_PARAMETER",
6+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ConfigurationSourceType.SECRETS_MANAGER",
7+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ConfigurationSourceType.CODE_PIPELINE",
8+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.SourceType.LAMBDA",
9+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.SourceType.SQS",
10+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.SourceType.SNS",
11+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.SourceType.EVENTS",
12+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.Platform.ARM_64",
13+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.Platform.X86_64",
14+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.PRE_CREATE_HOSTED_CONFIGURATION_VERSION",
15+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.PRE_START_DEPLOYMENT",
16+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.ON_DEPLOYMENT_START",
17+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.ON_DEPLOYMENT_STEP",
18+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.ON_DEPLOYMENT_BAKING",
19+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.ON_DEPLOYMENT_COMPLETE",
20+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.ActionPoint.ON_DEPLOYMENT_ROLLED_BACK",
21+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.IValidator",
22+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.IExtension",
23+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.IEnvironment",
24+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.IDeploymentStrategy",
25+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.IConfiguration",
26+
"docs-public-apis:@aws-cdk/aws-appconfig-alpha.IApplication",
27+
28+
"no-unused-type:@aws-cdk/aws-appconfig-alpha.PredefinedDeploymentStrategyId",
29+
"ref-via-interface:@aws-cdk/aws-appconfig-alpha.Application.addAgentToEcs.taskDef",
30+
"props-physical-name:@aws-cdk/aws-appconfig-alpha.ApplicationProps",
31+
"props-physical-name:@aws-cdk/aws-appconfig-alpha.DeploymentStrategyProps",
32+
"props-physical-name:@aws-cdk/aws-appconfig-alpha.EnvironmentProps",
33+
"props-physical-name:@aws-cdk/aws-appconfig-alpha.ExtensionProps",
34+
"events-in-interface",
35+
"events-method-signature",
36+
"events-generic"
437
]
538
}

packages/@aws-cdk/aws-appconfig-alpha/lib/application.ts

+9
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ export interface IApplication extends cdk.IResource {
2828

2929
/**
3030
* The ID of the application.
31+
* @attribute
3132
*/
3233
readonly applicationId: string;
3334

3435
/**
3536
* The Amazon Resource Name (ARN) of the application.
37+
* @attribute
3638
*/
3739
readonly applicationArn: string;
3840

@@ -73,6 +75,9 @@ export interface IApplication extends cdk.IResource {
7375
get environments(): IEnvironment[];
7476
}
7577

78+
/**
79+
* Properties for the Application construct
80+
*/
7681
export interface ApplicationProps {
7782
/**
7883
* The name of the application.
@@ -312,11 +317,15 @@ export class Application extends ApplicationBase {
312317

313318
/**
314319
* The ID of the application.
320+
*
321+
* @attribute
315322
*/
316323
public readonly applicationId: string;
317324

318325
/**
319326
* The Amazon Resource Name (ARN) of the application.
327+
*
328+
* @attribute
320329
*/
321330
public readonly applicationArn: string;
322331

packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts

+45-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import { IEnvironment } from './environment';
1616
import { ActionPoint, IEventDestination, ExtensionOptions, IExtension, IExtensible, ExtensibleBase } from './extension';
1717
import { getHash } from './private/hash';
1818

19+
/**
20+
* Options for the Configuration construct
21+
*/
1922
export interface ConfigurationOptions {
2023
/**
2124
* The deployment strategy for the configuration.
@@ -71,6 +74,9 @@ export interface ConfigurationOptions {
7174
readonly deploymentKey?: kms.IKey;
7275
}
7376

77+
/**
78+
* Properties for the Configuration construct.
79+
*/
7480
export interface ConfigurationProps extends ConfigurationOptions {
7581
/**
7682
* The application associated with the configuration.
@@ -327,6 +333,9 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE
327333
}
328334
}
329335

336+
/**
337+
* Options for HostedConfiguration
338+
*/
330339
export interface HostedConfigurationOptions extends ConfigurationOptions {
331340
/**
332341
* The content of the hosted configuration.
@@ -348,6 +357,9 @@ export interface HostedConfigurationOptions extends ConfigurationOptions {
348357
readonly versionLabel?: string;
349358
}
350359

360+
/**
361+
* Properties for HostedConfiguration
362+
*/
351363
export interface HostedConfigurationProps extends ConfigurationProps {
352364
/**
353365
* The content of the hosted configuration.
@@ -369,6 +381,9 @@ export interface HostedConfigurationProps extends ConfigurationProps {
369381
readonly versionLabel?: string;
370382
}
371383

384+
/**
385+
* A hosted configuration represents configuration stored in the AWS AppConfig hosted configuration store.
386+
*/
372387
export class HostedConfiguration extends ConfigurationBase {
373388
/**
374389
* The content of the hosted configuration.
@@ -469,6 +484,9 @@ export class HostedConfiguration extends ConfigurationBase {
469484
}
470485
}
471486

487+
/**
488+
* Options for SourcedConfiguration
489+
*/
472490
export interface SourcedConfigurationOptions extends ConfigurationOptions {
473491
/**
474492
* The location where the configuration is stored.
@@ -491,6 +509,9 @@ export interface SourcedConfigurationOptions extends ConfigurationOptions {
491509
readonly retrievalRole?: iam.IRole;
492510
}
493511

512+
/**
513+
* Properties for SourcedConfiguration.
514+
*/
494515
export interface SourcedConfigurationProps extends ConfigurationProps {
495516
/**
496517
* The location where the configuration is stored.
@@ -513,6 +534,10 @@ export interface SourcedConfigurationProps extends ConfigurationProps {
513534
readonly retrievalRole?: iam.IRole;
514535
}
515536

537+
/**
538+
* A sourced configuration represents configuration stored in an Amazon S3 bucket, AWS Secrets Manager secret, Systems Manager
539+
* (SSM) Parameter Store parameter, SSM document, or AWS CodePipeline.
540+
*/
516541
export class SourcedConfiguration extends ConfigurationBase {
517542
/**
518543
* The location where the configuration is stored.
@@ -680,15 +705,34 @@ export class SourcedConfiguration extends ConfigurationBase {
680705
* The configuration type.
681706
*/
682707
export enum ConfigurationType {
708+
/**
709+
* Freeform configuration profile. Allows you to store your data in the AWS AppConfig
710+
* hosted configuration store or another Systems Manager capability or AWS service that integrates
711+
* with AWS AppConfig.
712+
*
713+
* @see https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-free-form-configurations-creating.html
714+
*/
683715
FREEFORM = 'AWS.Freeform',
716+
717+
/**
718+
* Feature flag configuration profile. This configuration stores its data
719+
* in the AWS AppConfig hosted configuration store and the URI is simply hosted.
720+
*/
684721
FEATURE_FLAGS = 'AWS.AppConfig.FeatureFlags',
685722
}
686723

687724
/**
688725
* The validator type.
689726
*/
690727
export enum ValidatorType {
728+
/**
729+
* JSON Scema validator.
730+
*/
691731
JSON_SCHEMA = 'JSON_SCHEMA',
732+
733+
/**
734+
* Validate using a Lambda function.
735+
*/
692736
LAMBDA = 'LAMBDA',
693737
}
694738

@@ -700,7 +744,7 @@ export enum ConfigurationSourceType {
700744
SECRETS_MANAGER = 'SECRETS_MANAGER',
701745
SSM_PARAMETER = 'SSM_PARAMETER',
702746
SSM_DOCUMENT = 'SSM_DOCUMENT',
703-
CODE_PIPELINE = 'CODE_PIPELINE'
747+
CODE_PIPELINE = 'CODE_PIPELINE',
704748
}
705749

706750
export interface IValidator {

0 commit comments

Comments
 (0)