in lib/stacks/setup-stack.ts [20:80]
constructor(scope: cdk.Construct, id: string, props: cdk.StackProps) {
super(scope, id, props);
this.jenkinsBackupBucket = new s3.Bucket(this, "jenkinsBackupBucket", {});
this.gameDevOnAWSResourcesBucket = new s3.Bucket(
this,
"GameDevOnAWSResourcesBucket",
{}
);
this.gameDevOnAWSLoggingBucket = new s3.Bucket(
this,
"GameDevOnAWSLoggingBucket",
{}
);
this.ssmLoggingBucket = new s3.Bucket(this, "SSMLoggingBucket", {});
this.vpc = new ec2.Vpc(this, "aws-game-stuio-vpc", {
// in order to use internal DNS (private hostzone)
enableDnsHostnames: true,
enableDnsSupport: true,
});
this.ad = new SimpleADPattern(this, "StudioAD", {
vpc: this.vpc,
name: "simple-ad.mycompany",
});
const dhcpOptions = new ec2.CfnDHCPOptions(this, "simple-ad-dhcp-options", {
domainName: "simple-ad-dhcp-options",
domainNameServers: this.ad.dnsIpAddresses,
});
new ec2.CfnVPCDHCPOptionsAssociation(this, "simplead-dhcp-association", {
dhcpOptionsId: dhcpOptions.ref,
vpcId: this.vpc.vpcId,
});
// SSM state manager association for Workstations
new ssm.CfnAssociation(this, "setup-ad", {
name: "AWS-JoinDirectoryServiceDomain",
associationName: "JoinADForWorkstations",
parameters: {
directoryId: [this.ad.directoryId],
directoryName: [this.ad.name],
directoryOU: [this.ad.directoryOU],
dnsIpAddresses: [this.ad.dnsIpAddresses.join(",")],
},
scheduleExpression: "cron(0 0/30 * * * ? *)",
targets: [
{
key: "tag:Feature",
values: ["value:Join-AD"],
},
],
});
this.zone = new route53.PrivateHostedZone(this, "GameStuidoHostedZone", {
zoneName: "gamestudio.aws.internal",
vpc: this.vpc, // At least one VPC has to be added to a Private Hosted Zone.
});
this.awsBackup = new BackupPattern(this, "AWSBackup");
}