stale-answer-34162
10/12/2023, 7:59 PM// Create a VPC
let vpc = new awsx.ec2.Vpc('vpc', {
cidrBlock: "10.0.0.0/16",
numberOfAvailabilityZones: 2,
subnetSpecs: [
{ type: awsx.ec2.SubnetType.Private, cidrMask: 20 },
{ type: awsx.ec2.SubnetType.Public, cidrMask: 20 },
{ type: awsx.ec2.SubnetType.Private, cidrMask: 20 },
{ type: awsx.ec2.SubnetType.Public, cidrMask: 20 },
],
});
const subnetIds = vpc.publicSubnetIds.apply(publicSids =>
vpc.privateSubnetIds.apply(privateSids => publicSids.concat(privateSids))
);
const cluster = new eks.Cluster("eks-cluster", {
vpcId: vpc.vpcId,
subnetIds: subnetIds,
storageClasses: "io1",
deployDashboard: false,
roleMappings: [{
roleArn: role.arn.apply(arn => arn),
groups: ["system:masters"],
username: "pulumi:admin",
}],
vpcCniOptions: {
warmIpTarget: 4,
},
encryptRootBlockDevice: true,
enabledClusterLogTypes: [
"api",
"audit",
"authenticator",
],
version: "1.28",
nodeGroupOptions: {
instanceType: "t3.xlarge",
desiredCapacity: 3,
minSize: 1,
maxSize: 3,
labels: {"Environment": "dev"},
},
}, {
dependsOn: [eksPolicyAttachment]
});