Skip to content

Commit

Permalink
Merge branch 'master' into otaviom/appsync-ttl-required
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 14, 2021
2 parents 525f916 + 67cce37 commit e10e993
Show file tree
Hide file tree
Showing 119 changed files with 6,064 additions and 732 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

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 e10e993

Please sign in to comment.