Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// pick up to 3 AZs from environment.
const azs = new cdk.AvailabilityZoneProvider(this).availabilityZones.slice(0, 3);
// add an "AWS::CloudFormation::Stack" resource which uses the MongoDB quickstart
// https://aws.amazon.com/quickstart/architecture/mongodb/
// only non-default values are provided here.
new CfnStack(this, 'NestedStack', {
templateUrl: 'https://s3.amazonaws.com/quickstart-reference/mongodb/latest/templates/mongodb-master.template',
parameters: {
KeyPairName: 'my-key-pair',
RemoteAccessCIDR: '0.0.0.0/0',
AvailabilityZones: azs.join(','),
NumberOfAZs: azs.length.toString(),
MongoDBAdminPassword: 'root1234',
}
});
}
}
const params: any = {
RDGWCIDR: props.rdgwCIDR,
VPCID: props.vpc.vpcId,
PublicSubnet1ID: props.vpc.publicSubnets[0].subnetId,
PublicSubnet2ID: props.vpc.publicSubnets[1].subnetId,
AdminPassword: props.adminPassword,
AdminUser: props.adminUser,
DomainDNSName: props.domainDNSName,
KeyPairName: props.keyPairName,
NumberOfRDGWHosts: props.numberOfRDGWHosts,
QSS3BucketName: props.qss3BucketName,
QSS3KeyPrefix: props.qss3KeyPrefix,
RDGWInstanceType: props.rdgwInstanceType,
};
const nestedStack = new CfnStack(this, 'Resource', {
templateUrl: 'https://s3.amazonaws.com/quickstart-reference/microsoft/rdgateway/latest/templates/rdgw-standalone.template',
parameters: params
});
const securityGroup = ec2.SecurityGroup.fromSecurityGroupId(this, 'SecurityGroup',
nestedStack.getAtt('Outputs.RemoteDesktopGatewaySGID').toString());
const defaultPortRange = new ec2.TcpPort(RemoteDesktopGateway.PORT);
this.connections = new ec2.Connections({ securityGroups: [securityGroup], defaultPortRange });
}
}