Skip to content

Commit

Permalink
Merge branch 'master' into rds-port
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 14, 2021
2 parents cb88532 + 54b6cc6 commit af6d9d4
Show file tree
Hide file tree
Showing 169 changed files with 9,537 additions and 861 deletions.
16 changes: 12 additions & 4 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ pull_request_rules:
queue:
name: default
method: squash
commit_message: title+body
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
conditions:
- base!=release
- -title~=(WIP|wip)
Expand All @@ -40,7 +42,9 @@ pull_request_rules:
queue:
name: default
method: squash
commit_message: title+body
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
conditions:
- base!=release
- -title~=(WIP|wip)
Expand All @@ -62,7 +66,9 @@ pull_request_rules:
queue:
name: default
method: merge
commit_message: title+body
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
conditions:
- -title~=(WIP|wip)
- -label~=(blocked|do-not-merge)
Expand Down Expand Up @@ -106,7 +112,9 @@ pull_request_rules:
queue:
name: default
method: squash
commit_message: title+body
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
conditions:
- -title~=(WIP|wip)
- -label~=(blocked|do-not-merge)
Expand Down
7 changes: 7 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@ removed:@aws-cdk/aws-stepfunctions-tasks.EmrCreateClusterProps.autoTerminationPo
# Changed property securityGroupId to optional because either securityGroupId or
# securityGroupName is required. Therefore securityGroupId is no longer mandatory.
weakened:@aws-cdk/cloud-assembly-schema.SecurityGroupContextQuery

# refactor autoscaling lifecycle hook target bind() methods to make role optional by
# having bind() methods create the role if it isn't passed to them
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.FunctionHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.QueueHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.TopicHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling.ILifecycleHookTarget.bind

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-amplify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,13 @@ const amplifyApp = new amplify.App(stack, 'App', {
],
});
```

## Deploying Assets

`sourceCodeProvider` is optional; when this is not specified the Amplify app can be deployed to using `.zip` packages. The `asset` property can be used to deploy S3 assets to Amplify as part of the CDK:

```ts
const asset = new assets.Asset(this, "SampleAsset", {});
const amplifyApp = new amplify.App(this, 'MyApp', {});
const branch = amplifyApp.addBranch("dev", { asset: asset });
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
export interface AmplifyJobId {
/**
* If this field is included in an event passed to "IsComplete", it means we
* initiated an Amplify deployment that should be monitored using
* amplify:GetJob
*/
AmplifyJobId?: string;
}

export type ResourceEvent = AWSLambda.CloudFormationCustomResourceEvent & AmplifyJobId;

export interface IsCompleteResponse {
/**
* Indicates if the resource operation is complete or should we retry.
*/
readonly IsComplete: boolean;

/**
* Additional/changes to resource attributes.
*/
readonly Data?: { [name: string]: any };
};

export abstract class ResourceHandler {
protected readonly requestId: string;
protected readonly logicalResourceId: string;
protected readonly requestType: 'Create' | 'Update' | 'Delete';
protected readonly physicalResourceId?: string;
protected readonly event: ResourceEvent;

constructor(event: ResourceEvent) {
this.requestType = event.RequestType;
this.requestId = event.RequestId;
this.logicalResourceId = event.LogicalResourceId;
this.physicalResourceId = (event as any).PhysicalResourceId;
this.event = event;
}

public onEvent() {
switch (this.requestType) {
case 'Create':
return this.onCreate();
case 'Update':
return this.onUpdate();
case 'Delete':
return this.onDelete();
}

throw new Error(`Invalid request type ${this.requestType}`);
}

public isComplete() {
switch (this.requestType) {
case 'Create':
return this.isCreateComplete();
case 'Update':
return this.isUpdateComplete();
case 'Delete':
return this.isDeleteComplete();
}

throw new Error(`Invalid request type ${this.requestType}`);
}

protected log(x: any) {
// eslint-disable-next-line no-console
console.log(JSON.stringify(x, undefined, 2));
}

protected abstract async onCreate(): Promise<AmplifyJobId>;
protected abstract async onDelete(): Promise<void>;
protected abstract async onUpdate(): Promise<AmplifyJobId>;
protected abstract async isCreateComplete(): Promise<IsCompleteResponse>;
protected abstract async isDeleteComplete(): Promise<IsCompleteResponse>;
protected abstract async isUpdateComplete(): Promise<IsCompleteResponse>;
}
Loading

0 comments on commit af6d9d4

Please sign in to comment.