-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from aws-samples/staging
Merging changes from Staging to main
- Loading branch information
Showing
14 changed files
with
1,299 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Construct } from "constructs"; | ||
import * as cloudformation_include from "aws-cdk-lib/cloudformation-include"; | ||
import { CfnRole } from "aws-cdk-lib/aws-iam"; | ||
|
||
export interface Cloud9EnvironmentProps { | ||
name?: string; | ||
vpcId: string; | ||
subnetId: string; | ||
templateFile: string; | ||
cloud9OwnerArn?: string; | ||
} | ||
|
||
export class Cloud9Environment extends Construct { | ||
public readonly c9Role: CfnRole; | ||
constructor(scope: Construct, id: string, props: Cloud9EnvironmentProps) { | ||
super(scope, id); | ||
|
||
const template = new cloudformation_include.CfnInclude(this, 'Cloud9Template', { | ||
templateFile: props.templateFile, | ||
parameters: { | ||
'CreateVPC': false, | ||
'Cloud9VPC': props.vpcId, | ||
'Cloud9Subnet': props.subnetId | ||
}, | ||
preserveLogicalIds: false | ||
}); | ||
|
||
if (props.name) { | ||
template.getParameter("EnvironmentName").default = props.name; | ||
} | ||
|
||
if (props.cloud9OwnerArn) { | ||
template.getParameter("Cloud9OwnerRole").default = props.cloud9OwnerArn.valueOf(); | ||
} | ||
|
||
this.c9Role = template.getResource("C9Role") as CfnRole; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.