Skip to content

Commit

Permalink
Merge branch 'master' into aws-iot-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 22, 2021
2 parents f08680b + 9714c40 commit 345aa76
Show file tree
Hide file tree
Showing 22 changed files with 125 additions and 59 deletions.
3 changes: 2 additions & 1 deletion pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ cat > ${distdir}/build.json <<HERE
}
HERE

# copy CHANGELOG.md to dist/ for github releases
# copy CHANGELOG.md and RELEASE_NOTES.md to dist/ for github releases
cp ${changelog_file} ${distdir}/CHANGELOG.md
cp RELEASE_NOTES.md ${distdir}/RELEASE_NOTES.md

# defensive: make sure our artifacts don't use the version marker (this means
# that "pack" will always fails when building in a dev environment)
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-amplify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const amplifyApp = new amplify.App(this, 'MyApp', {
},
artifacts: {
baseDirectory: 'public',
files: '**/*'
files:
- '**/*'
}
}
})
Expand Down
81 changes: 50 additions & 31 deletions packages/@aws-cdk/aws-codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ npm i @aws-cdk/aws-codebuild

Import it into your code:

```ts
```ts nofixture
import * as codebuild from '@aws-cdk/aws-codebuild';
```

Expand All @@ -56,7 +56,6 @@ CodeBuild!`:
Use an AWS CodeCommit repository as the source of this build:

```ts
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codecommit from '@aws-cdk/aws-codecommit';

const repository = new codecommit.Repository(this, 'MyRepo', { repositoryName: 'foo' });
Expand All @@ -70,10 +69,8 @@ new codebuild.Project(this, 'MyFirstCodeCommitProject', {
Create a CodeBuild project with an S3 bucket as the source:

```ts
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as s3 from '@aws-cdk/aws-s3';

const bucket = new s3.Bucket(this, 'MyBucket');

new codebuild.Project(this, 'MyProject', {
source: codebuild.Source.s3({
bucket: bucket,
Expand Down Expand Up @@ -140,7 +137,9 @@ const gitHubSource = codebuild.Source.gitHub({
CodeBuild Projects can produce Artifacts and upload them to S3. For example:

```ts
const project = codebuild.Project(stack, 'MyProject', {
declare const bucket: s3.Bucket;

const project = new codebuild.Project(this, 'MyProject', {
buildSpec: codebuild.BuildSpec.fromObject({
version: '0.2',
}),
Expand Down Expand Up @@ -193,7 +192,7 @@ new codebuild.Project(this, 'Project', {
owner: 'awslabs',
repo: 'aws-cdk',
}),
cache: codebuild.Cache.bucket(new Bucket(this, 'Bucket'))
cache: codebuild.Cache.bucket(new s3.Bucket(this, 'Bucket'))
});
```

Expand All @@ -214,7 +213,7 @@ new codebuild.Project(this, 'Project', {
}),

// Enable Docker AND custom caching
cache: codebuild.Cache.local(LocalCacheMode.DOCKER_LAYER, LocalCacheMode.CUSTOM)
cache: codebuild.Cache.local(codebuild.LocalCacheMode.DOCKER_LAYER, codebuild.LocalCacheMode.CUSTOM)
});
```

Expand Down Expand Up @@ -260,6 +259,8 @@ Note that the `WindowsBuildImage` version of the static methods accepts an optio
which can be either `WindowsImageType.STANDARD`, the default, or `WindowsImageType.SERVER_2019`:

```ts
declare const ecrRepository: ecr.Repository;

new codebuild.Project(this, 'Project', {
environment: {
buildImage: codebuild.WindowsBuildImage.fromEcrRepository(ecrRepository, 'v1.0', codebuild.WindowsImageType.SERVER_2019),
Expand All @@ -269,7 +270,7 @@ new codebuild.Project(this, 'Project', {
objectKey: 'path/to/cert.pem',
},
},
...
// ...
})
```

Expand All @@ -296,7 +297,7 @@ new codebuild.Project(this, 'Project', {
environment: {
buildImage: codebuild.LinuxGpuBuildImage.DLC_TENSORFLOW_2_1_0_INFERENCE,
},
...
// ...
})
```

Expand All @@ -315,7 +316,7 @@ new codebuild.Project(this, 'Project', {
buildImage: codebuild.LinuxGpuBuildImage.awsDeepLearningContainersImage(
'tensorflow-inference', '2.1.0-gpu-py36-cu101-ubuntu18.04', '123456789012'),
},
...
// ...
})
```

Expand All @@ -331,10 +332,9 @@ By default, logs will go to cloudwatch.
new codebuild.Project(this, 'Project', {
logging: {
cloudWatch: {
logGroup: new cloudwatch.LogGroup(this, `MyLogGroup`),
logGroup: new logs.LogGroup(this, `MyLogGroup`),
}
},
...
})
```

Expand All @@ -347,7 +347,6 @@ new codebuild.Project(this, 'Project', {
bucket: new s3.Bucket(this, `LogBucket`)
}
},
...
})
```

Expand All @@ -358,7 +357,7 @@ like GitHub:

```ts
new codebuild.GitHubSourceCredentials(this, 'CodeBuildGitHubCreds', {
accessToken: cdk.SecretValue.secretsManager('my-token'),
accessToken: SecretValue.secretsManager('my-token'),
});
// GitHub Enterprise is almost the same,
// except the class is called GitHubEnterpriseSourceCredentials
Expand All @@ -368,8 +367,8 @@ and BitBucket:

```ts
new codebuild.BitBucketSourceCredentials(this, 'CodeBuildBitBucketCreds', {
username: cdk.SecretValue.secretsManager('my-bitbucket-creds', { jsonField: 'username' }),
password: cdk.SecretValue.secretsManager('my-bitbucket-creds', { jsonField: 'password' }),
username: SecretValue.secretsManager('my-bitbucket-creds', { jsonField: 'username' }),
password: SecretValue.secretsManager('my-bitbucket-creds', { jsonField: 'password' }),
});
```

Expand Down Expand Up @@ -409,8 +408,10 @@ if you'd rather not have those permissions added,
you can opt out of it when creating the project:

```ts
declare const source: codebuild.Source;

const project = new codebuild.Project(this, 'Project', {
// ...
source,
grantReportGroupPermissions: false,
});
```
Expand All @@ -419,10 +420,13 @@ Alternatively, you can specify an ARN of an existing resource group,
instead of a simple name, in your buildspec:

```ts
declare const source: codebuild.Source;

// create a new ReportGroup
const reportGroup = new codebuild.ReportGroup(this, 'ReportGroup');

const project = new codebuild.Project(this, 'Project', {
source,
buildSpec: codebuild.BuildSpec.fromObject({
// ...
reports: {
Expand All @@ -438,6 +442,9 @@ const project = new codebuild.Project(this, 'Project', {
If you do that, you need to grant the project's role permissions to write reports to that report group:

```ts
declare const project: codebuild.Project;
declare const reportGroup: codebuild.ReportGroup;

reportGroup.grantWrite(project);
```

Expand All @@ -456,8 +463,12 @@ project as a AWS CloudWatch event rule target:

```ts
// start build when a commit is pushed
import * as codecommit from '@aws-cdk/aws-codecommit';
import * as targets from '@aws-cdk/aws-events-targets';

declare const codeCommitRepository: codecommit.Repository;
declare const project: codebuild.Project;

codeCommitRepository.onCommit('OnCommit', {
target: new targets.CodeBuildProject(project),
});
Expand All @@ -469,6 +480,10 @@ To define Amazon CloudWatch event rules for build projects, use one of the `onXx
methods:

```ts
import * as targets from '@aws-cdk/aws-events-targets';
declare const fn: lambda.Function;
declare const project: codebuild.Project;

const rule = project.onStateChange('BuildStateChange', {
target: new targets.LambdaFunction(fn)
});
Expand All @@ -480,7 +495,11 @@ To define CodeStar Notification rules for Projects, use one of the `notifyOnXxx(
They are very similar to `onXxx()` methods for CloudWatch events:

```ts
const target = new chatbot.SlackChannelConfiguration(stack, 'MySlackChannel', {
import * as chatbot from '@aws-cdk/aws-chatbot';

declare const project: codebuild.Project;

const target = new chatbot.SlackChannelConfiguration(this, 'MySlackChannel', {
slackChannelConfigurationName: 'YOUR_CHANNEL_NAME',
slackWorkspaceId: 'YOUR_SLACK_WORKSPACE_ID',
slackChannelId: 'YOUR_SLACK_CHANNEL_ID',
Expand All @@ -495,6 +514,10 @@ CodeBuild Projects can get their sources from multiple places, and produce
multiple outputs. For example:

```ts
import * as codecommit from '@aws-cdk/aws-codecommit';
declare const repo: codecommit.Repository;
declare const bucket: s3.Bucket;

const project = new codebuild.Project(this, 'MyProject', {
secondarySources: [
codebuild.Source.codeCommit({
Expand Down Expand Up @@ -586,6 +609,8 @@ to access the resources that it needs by using the
For example:

```ts
declare const loadBalancer: elbv2.ApplicationLoadBalancer;

const vpc = new ec2.Vpc(this, 'MyVPC');
const project = new codebuild.Project(this, 'MyProject', {
vpc: vpc,
Expand All @@ -608,7 +633,7 @@ The only supported file system type is `EFS`.
For example:

```ts
new codebuild.Project(stack, 'MyProject', {
new codebuild.Project(this, 'MyProject', {
buildSpec: codebuild.BuildSpec.fromObject({
version: '0.2',
}),
Expand All @@ -635,9 +660,9 @@ It returns an object containing the batch service role that was created,
or `undefined` if batch builds could not be enabled, for example if the project was imported.

```ts
import * as codebuild from '@aws-cdk/aws-codebuild';
declare const source: codebuild.Source;

const project = new codebuild.Project(this, 'MyProject', { ... });
const project = new codebuild.Project(this, 'MyProject', { source, });

if (project.enableBatchBuilds()) {
console.log('Batch builds were enabled');
Expand All @@ -652,9 +677,7 @@ The default is 60 minutes.
An example of overriding the default follows.

```ts
import * as codebuild from '@aws-cdk/aws-codebuild';

new codebuild.Project(stack, 'MyProject', {
new codebuild.Project(this, 'MyProject', {
timeout: Duration.minutes(90)
});
```
Expand All @@ -665,9 +688,7 @@ As an example, to allow your Project to queue for up to thirty (30) minutes befo
use the following code.

```ts
import * as codebuild from '@aws-cdk/aws-codebuild';

new codebuild.Project(stack, 'MyProject', {
new codebuild.Project(this, 'MyProject', {
queuedTimeout: Duration.minutes(30)
});
```
Expand All @@ -679,9 +700,7 @@ It is possible to limit the maximum concurrent builds to value between 1 and the
By default there is no explicit limit.

```ts
import * as codebuild from '@aws-cdk/aws-codebuild';

new codebuild.Project(stack, 'MyProject', {
new codebuild.Project(this, 'MyProject', {
concurrentBuildLimit: 1
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export interface UntrustedCodeBoundaryPolicyProps {
*
* @example
*
* iam.PermissionsBoundary.of(project).apply(new UntrustedCodeBoundaryPolicy(this, 'Boundary'));
* declare const project: codebuild.Project;
* iam.PermissionsBoundary.of(project).apply(new codebuild.UntrustedCodeBoundaryPolicy(this, 'Boundary'));
*/
export class UntrustedCodeBoundaryPolicy extends iam.ManagedPolicy {
constructor(scope: Construct, id: string, props: UntrustedCodeBoundaryPolicyProps = {}) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-kinesisanalytics-flink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import * as logs from '@aws-cdk/aws-logs';

const flinkApp = new flink.Application(this, 'Application', {
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
runtime: file.Runtime.FLINK_1_11,
runtime: file.Runtime.FLINK_1_13,
checkpointingEnabled: true, // default is true
checkpointInterval: cdk.Duration.seconds(30), // default is 1 minute
minPauseBetweenCheckpoints: cdk.Duration.seconds(10), // default is 5 seconds
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-kinesisanalytics-flink/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export enum MetricsLevel {
* configuration.
*/
export interface PropertyGroups {
readonly [propertyId: string]: {[mapKey: string]: string};
readonly [propertyId: string]: { [mapKey: string]: string };
}

/**
Expand All @@ -53,6 +53,9 @@ export class Runtime {
/** Flink Version 1.11 */
public static readonly FLINK_1_11 = Runtime.of('FLINK-1_11');

/** Flink Version 1.13 */
public static readonly FLINK_1_13 = Runtime.of('FLINK-1_13');

/** Create a new Runtime with with an arbitrary Flink version string */
public static of(value: string) {
return new Runtime(value);
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ logical application. You can then treat that new unit the same way you used
to be able to treat a single stack: by instantiating it multiple times
for different instances of your application.

You can define a custom subclass of `Construct`, holding one or more
You can define a custom subclass of `Stage`, holding one or more
`Stack`s, to represent a single logical instance of your application.

As a final note: `Stack`s are not a unit of reuse. They describe physical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ function addBootstrapVersionRule(stack: Stack, requiredVersion: number, bootstra

const param = new CfnParameter(stack, 'BootstrapVersion', {
type: 'AWS::SSM::Parameter::Value<String>',
description: 'Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store.',
description: `Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. ${cxapi.SSMPARAM_NO_INVALIDATE}`,
default: bootstrapStackVersionSsmParameter,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe('new style synthesis', () => {
const template = app.synth().getStackByName('Stack').template;
expect(template?.Parameters?.BootstrapVersion?.Type).toEqual('AWS::SSM::Parameter::Value<String>');
expect(template?.Parameters?.BootstrapVersion?.Default).toEqual('/cdk-bootstrap/hnb659fds/version');
expect(template?.Parameters?.BootstrapVersion?.Description).toContain(cxapi.SSMPARAM_NO_INVALIDATE);

const assertions = template?.Rules?.CheckBootstrapVersion?.Assertions ?? [];
expect(assertions.length).toEqual(1);
Expand Down
11 changes: 10 additions & 1 deletion packages/@aws-cdk/cx-api/lib/cxapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ export const CLI_VERSION_ENV = 'CDK_CLI_VERSION';
/**
* If a context value is an object with this key, it indicates an error
*/
export const PROVIDER_ERROR_KEY = '$providerError';
export const PROVIDER_ERROR_KEY = '$providerError';


/**
* This SSM parameter does not invalidate the template
*
* If this string occurs in the description of an SSM parameter, the CLI
* will not assume that the stack must always be redeployed.
*/
export const SSMPARAM_NO_INVALIDATE = '[cdk:skip]';
Loading

0 comments on commit 345aa76

Please sign in to comment.