-
Notifications
You must be signed in to change notification settings - Fork 14
/
stack-web.ts
66 lines (55 loc) · 2.28 KB
/
stack-web.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import * as cdk from "aws-cdk-lib";
import { Construct } from "constructs";
import { aws_iam as iam, CfnOutput } from 'aws-cdk-lib';
import { aws_s3 as s3 } from "aws-cdk-lib";
import { aws_codecommit as codecommit } from "aws-cdk-lib";
import * as path from 'path';
import { AmplifyDeploy } from "../../constructs/construct-amplify-deploy/construct-amplify-deploy";
interface WebStackProps extends cdk.StackProps {
apiId: string;
graphqlUrl: string;
identityPoolId: string;
userPoolId: string;
userPoolWebClientId: string;
landingBucketName: string;
}
export class WebStack extends cdk.Stack {
public amplifyDeployment: AmplifyDeploy;
public sagemakerAnalysisBucket: s3.Bucket;
readonly sagemakerCodecommitRepo: codecommit.Repository;
constructor(scope: Construct, id: string, props: WebStackProps) {
super(scope, id, props);
this.amplifyDeployment = new AmplifyDeploy(this, 'AmplifyDeployment', {
appPath: path.join(__dirname, './app/sample-ui-cloudscape'),
repoName: 'CDLWebAppRepo',
region: this.region,
apiId: props.apiId,
graphqlUrl: props.graphqlUrl,
identityPoolId: props.identityPoolId,
userPoolId: props.userPoolId,
userPoolWebClientId: props.userPoolWebClientId,
landingBucketName: props.landingBucketName,
});
new CfnOutput(this, 'CDLWebAppRepositoryCloneUrl', {
value: this.amplifyDeployment.repository.repositoryCloneUrlHttp,
description: 'CDLWebAppRepositoryLink',
exportName: 'CDLWebAppRepositoryLink'
});
new CfnOutput(this, 'CDLWebAppId', {
value: this.amplifyDeployment.amplifyApp.appId,
description: 'CDLWebAppRepository',
exportName: 'CDLWebAppRepository'
});
new CfnOutput(this, 'CDLAmplifyLink', {
value: `https://${this.amplifyDeployment.amplifyApp.env.region}.console.aws.amazon.com/amplify/home?region=${this.amplifyDeployment.amplifyApp.env.region}#/${this.amplifyDeployment.amplifyApp.appId}`,
description: 'CDLAmplifyLink',
exportName: 'CDLAmplifyLink'
});
new CfnOutput(this, 'CDLWebAppDomain', {
value: `https://dev.${this.amplifyDeployment.amplifyApp.defaultDomain}`,
description: 'CDLWebAppDomain',
exportName: 'CDLWebAppDomain'
});
cdk.Tags.of(this).add("component", "amplifyDeployment");
}
}