Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptSmith committed Oct 4, 2023
1 parent 6fe9dc5 commit 401dd02
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion deployment/bin/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ new SSMClient().send(new GetParameterCommand({ Name: `/app/${envName}/${repo}/en
env: { account: env.account, region: "us-east-1" }
});


const apiStack = new ApiStack(app, "TranscriptionStack", {
stackName: apiStackName,
synthesizer: new cdk.CliCredentialsStackSynthesizer({
Expand Down
6 changes: 3 additions & 3 deletions deployment/lib/api-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class ApiStack extends cdk.Stack {
const userPoolArn = cdk.Fn.importValue(`${props.parameters.UserPoolStackName}-UserPoolArn`);
const userPool = cognito.UserPool.fromUserPoolArn(this, "UserPool", userPoolArn);
const auth = new apigateway.CognitoUserPoolsAuthorizer(this, "Authorizer", {
cognitoUserPools: [userPool],
cognitoUserPools: [userPool]
});
const apiCertificate = certificatemanager.Certificate.fromCertificateArn(this, "Certificate", props.parameters.RegionalCertificateArn);
const api = new apigateway.RestApi(this, "Api", {
Expand All @@ -141,12 +141,12 @@ export class ApiStack extends cdk.Stack {
allowMethods: apigateway.Cors.ALL_METHODS,
allowHeaders: apigateway.Cors.DEFAULT_HEADERS,
maxAge: cdk.Duration.days(10)
},
}
});
const apiFunctionIntegration = new apigateway.LambdaIntegration(apiFunction);
const apiResourceAuthorized = api.root.addResource("{proxy+}");
apiResourceAuthorized.addMethod("ANY", apiFunctionIntegration, {
authorizer: auth,
authorizer: auth
});

new wafv2.CfnWebACLAssociation(this, "ApiWebACLAssociation", {
Expand Down
8 changes: 4 additions & 4 deletions deployment/lib/front-end-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface FrontendStackProps extends cdk.StackProps {
readonly HostedZoneName: string;
readonly GlobalWafArn: string;
readonly GlobalCertificateArn: string;
}
};
}

export class FrontEndStack extends cdk.Stack {
Expand Down Expand Up @@ -47,7 +47,7 @@ export class FrontEndStack extends cdk.Stack {
domainNames: [parameters.FrontEndDomainName],
certificate: certificatemanager.Certificate.fromCertificateArn(this, "distribution-certificate", parameters.GlobalCertificateArn),
defaultBehavior: {
origin: new origins.S3Origin(distributionBucket, {originAccessIdentity}),
origin: new origins.S3Origin(distributionBucket, { originAccessIdentity }),
viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
edgeLambdas: [{
functionVersion: edgeLambda.currentVersion,
Expand All @@ -61,13 +61,13 @@ export class FrontEndStack extends cdk.Stack {
new route53.ARecord(this, "distribution-alias-record", {
recordName: parameters.FrontEndDomainName,
zone: distributionHostedZone,
target: route53.RecordTarget.fromAlias(cloudFrontTarget),
target: route53.RecordTarget.fromAlias(cloudFrontTarget)
});

new s3deployment.BucketDeployment(this, "distribution-deployment", {
sources: [s3deployment.Source.asset("../frontend/out")],
destinationBucket: distributionBucket,
distribution,
distribution
});
}
}
15 changes: 7 additions & 8 deletions deployment/lib/github-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ const appResourcePolicies = (tagKey: string, tagValue: string, stacks: string[])
"ec2:DeleteSecurityGroup",
"ec2:CreateTags",
"ec2:DeleteTags",
"ec2:RevokeSecurityGroupIngress",
"ec2:RevokeSecurityGroupEgress",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:RevokeSecurityGroupIngress",
"ec2:RevokeSecurityGroupEgress",
"iam:*",
"events:*",
"route53:*",
"wafv2:*"
],
resources: ["*"],
}),
resources: ["*"]
})
]);

export class GitHubStack extends cdk.Stack {
Expand Down Expand Up @@ -74,10 +74,10 @@ export class GitHubStack extends cdk.Stack {
"ec2:DescribeRouteTables",
"ec2:DescribeVpcs",
"ec2:DescribeVpnGateways",
"ec2:DescribeSubnets",
"ec2:DescribeSubnets"
],
resources: ["*"],
})
resources: ["*"]
});

// To manage the stacks
const cloudformationPolicy = new iam.PolicyStatement({
Expand Down Expand Up @@ -124,7 +124,6 @@ export class GitHubStack extends cdk.Stack {
maxSessionDuration: cdk.Duration.hours(1)
});


assetBucket.grantReadWrite(deployRole);

new cdk.CfnOutput(this, "deployRoleArn", {
Expand Down

0 comments on commit 401dd02

Please sign in to comment.