Skip to content

Commit

Permalink
chore(release): 1.182.0 (#23262)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Dec 7, 2022
2 parents 758abae + c3651fe commit f2ac3be
Show file tree
Hide file tree
Showing 264 changed files with 9,857 additions and 1,732 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
name: Stale issue job
steps:
- uses: aws-actions/stale-issue-cleanup@v5
- uses: aws-actions/stale-issue-cleanup@v6
with:
# Setting messages to an empty string will cause the automation to skip
# that category
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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.

## [1.182.0](https://github.com/aws/aws-cdk/compare/v1.181.1...v1.182.0) (2022-12-07)


### Features

* **cfnspec:** cloudformation spec v99.0.0 ([#23006](https://github.com/aws/aws-cdk/issues/23006)) ([c510416](https://github.com/aws/aws-cdk/commit/c510416b3bc0b0756adbcc4d10c51ca77dab1176))
* **lambda-go:** allow configuration of GOPROXY ([#23257](https://github.com/aws/aws-cdk/issues/23257)) ([67103d9](https://github.com/aws/aws-cdk/commit/67103d9b82aa80f06aa5612d6ca067b1acfb8f24)), closes [#23171](https://github.com/aws/aws-cdk/issues/23171)


### Bug Fixes

* **cli:** typescript init templates fail with error in build step ([#23130](https://github.com/aws/aws-cdk/issues/23130)) ([b06cd20](https://github.com/aws/aws-cdk/commit/b06cd207ddc87fa3e73a1ce22f8632b54cc286ae))

## [1.181.1](https://github.com/aws/aws-cdk/compare/v1.181.0...v1.181.1) (2022-11-29)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.64",
"cdk-generate-synthetic-examples": "^0.1.71",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
Expand Down
12 changes: 10 additions & 2 deletions packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ export interface ScheduledActionProps extends BasicScheduledActionProps {
* Define a scheduled scaling action
*/
export class ScheduledAction extends Resource {
/**
* The name of the scheduled action.
*
* @attribute
*/
public readonly scheduledActionName: string;

constructor(scope: Construct, id: string, props: ScheduledActionProps) {
super(scope, id);

Expand All @@ -100,7 +107,7 @@ export class ScheduledAction extends Resource {
// add a warning on synth when minute is not defined in a cron schedule
props.schedule._bind(this);

new CfnScheduledAction(this, 'Resource', {
const resource = new CfnScheduledAction(this, 'Resource', {
autoScalingGroupName: props.autoScalingGroup.autoScalingGroupName,
startTime: formatISO(props.startTime),
endTime: formatISO(props.endTime),
Expand All @@ -110,6 +117,7 @@ export class ScheduledAction extends Resource {
recurrence: props.schedule.expressionString,
timeZone: props.timeZone,
});
this.scheduledActionName = resource.attrScheduledActionName;
}
}

Expand All @@ -130,4 +138,4 @@ function formatISO(date?: Date) {
}
return num;
}
}
}
17 changes: 14 additions & 3 deletions packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ describeDeprecated('scheduled action', () => {
},
UpdatePolicy: {
AutoScalingRollingUpdate: {
WaitOnResourceSignals: false,
PauseTime: 'PT0S',
SuspendProcesses: [
'HealthCheck',
'ReplaceUnhealthy',
Expand Down Expand Up @@ -156,12 +154,25 @@ describeDeprecated('scheduled action', () => {
});
});

test('ScheduledActions have a name', () => {
const stack = new cdk.Stack();
const asg = makeAutoScalingGroup(stack);

const action = asg.scaleOnSchedule('ScaleOutAtMiddaySeoul', {
schedule: autoscaling.Schedule.cron({ hour: '12', minute: '0' }),
minCapacity: 12,
timeZone: 'Asia/Seoul',
});

expect(action.scheduledActionName).toBeDefined();
});

function makeAutoScalingGroup(scope: constructs.Construct) {
const vpc = new ec2.Vpc(scope, 'VPC');
return new autoscaling.AutoScalingGroup(scope, 'ASG', {
vpc,
instanceType: new ec2.InstanceType('t2.micro'),
machineImage: new ec2.AmazonLinuxImage(),
updateType: autoscaling.UpdateType.ROLLING_UPDATE,
updatePolicy: autoscaling.UpdatePolicy.rollingUpdate(),
});
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"@types/sinon": "^9.0.11",
"@types/yaml": "1.9.6",
"aws-sdk": "^2.848.0",
"cdk8s": "^1.8.44",
"cdk8s": "^1.8.51",
"cdk8s-plus-21": "^1.0.0-beta.186",
"jest": "^27.5.1",
"sinon": "^9.2.4"
Expand Down
13 changes: 13 additions & 0 deletions packages/@aws-cdk/aws-lambda-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ new lambda.GoFunction(this, 'handler', {
});
```

By default this construct doesn't use any Go module proxies. This is contrary to
a standard Go installation, which would use the Google proxy by default. To
recreate that behavior, do the following:

```ts
new lambda.GoFunction(this, 'GoFunction', {
entry: 'app/cmd/api',
bundling: {
goProxies: [lambda.GoFunction.GOOGLE_GOPROXY, 'direct'],
},
});
```

## Command hooks

It is possible to run additional commands by specifying the `commandHooks` prop:
Expand Down
6 changes: 5 additions & 1 deletion packages/@aws-cdk/aws-lambda-go/lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@ export class Bundling implements cdk.BundlingOptions {

const cgoEnabled = props.cgoEnabled ? '1' : '0';

const environment = {
const environment: Record<string, string> = {
CGO_ENABLED: cgoEnabled,
GO111MODULE: 'on',
GOARCH: props.architecture.dockerPlatform.split('/')[1],
GOOS: 'linux',
...props.environment,
};

if (props.goProxies) {
environment.GOPROXY = props.goProxies.join(',');
}

// Docker bundling
const shouldBuildImage = props.forcedDockerBundling || !Bundling.runsLocally;
this.image = shouldBuildImage
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-lambda-go/lib/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export interface GoFunctionProps extends lambda.FunctionOptions {
* A Golang Lambda function
*/
export class GoFunction extends lambda.Function {
/**
* The address of the Google Go proxy
*/
public static readonly GOOGLE_GOPROXY = 'https://proxy.golang.org';

constructor(scope: Construct, id: string, props: GoFunctionProps) {
if (props.runtime && (props.runtime.family !== lambda.RuntimeFamily.GO && props.runtime.family != lambda.RuntimeFamily.OTHER)) {
throw new Error('Only `go` and `provided` runtimes are supported.');
Expand Down
22 changes: 22 additions & 0 deletions packages/@aws-cdk/aws-lambda-go/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@ export interface BundlingOptions {
* @default - false
*/
readonly cgoEnabled?: boolean;

/**
* What Go proxies to use to fetch the packages involved in the build
*
* Pass a list of proxy addresses in order, and/or the string `'direct'` to
* attempt direct access.
*
* By default this construct uses no proxies, but a standard Go install would
* use the Google proxy by default. To recreate that behavior, do the following:
*
* ```ts
* new lambda.GoFunction(this, 'GoFunction', {
* entry: 'app/cmd/api',
* bundling: {
* goProxies: [lambda.GoFunction.GOOGLE_GOPROXY, 'direct'],
* },
* });
* ```
*
* @default - Direct access
*/
readonly goProxies?: string[];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"delay": "5.0.0",
"esbuild": "^0.15.14"
"esbuild": "^0.15.15"
},
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-organizations/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc');
baseConfig.parserOptions.project = __dirname + '/tsconfig.json';
module.exports = baseConfig;
19 changes: 19 additions & 0 deletions packages/@aws-cdk/aws-organizations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.js
*.js.map
*.d.ts
tsconfig.json
node_modules
*.generated.ts
dist
.jsii

.LAST_BUILD
.nyc_output
coverage
.nycrc
.LAST_PACKAGE
*.snk
nyc.config.js
!.eslintrc.js
!jest.config.js
junit.xml
29 changes: 29 additions & 0 deletions packages/@aws-cdk/aws-organizations/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Don't include original .ts files when doing `npm pack`
*.ts
!*.d.ts
coverage
.nyc_output
*.tgz

dist
.LAST_PACKAGE
.LAST_BUILD
!*.js

# Include .jsii
!.jsii

*.snk

*.tsbuildinfo

tsconfig.json

.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
junit.xml
test/
!*.lit.ts

0 comments on commit f2ac3be

Please sign in to comment.