damp-salesmen-74351
10/04/2023, 5:49 PMnat_gateways=pulumi_awsx.ec2.NatGatewayConfigurationArgs(
strategy=pulumi_awsx.ec2.NatGatewayStrategy.NONE,
),
But it still create them vpc-st-public-1
, vpc-st-public-2
,vpc-st-public-3
as you see in this log:
Updating (st):
Type Name Status Info
+ pulumi:pulumi:Stack devops-st created (0.00s) 35 messages
+ └─ awsx:ec2:Vpc vpc-st created (0.12s)
+ └─ aws:ec2:Vpc vpc-st created (1s)
+ ├─ aws:ec2:Subnet vpc-st-public-1 created (10s)
+ │ └─ aws:ec2:RouteTable vpc-st-public-1 created (0.51s)
+ │ ├─ aws:ec2:RouteTableAssociation vpc-st-public-1 created (0.40s)
+ │ └─ aws:ec2:Route vpc-st-public-1 created (0.64s)
+ ├─ aws:ec2:Subnet vpc-st-private-2 created (0.90s)
+ │ └─ aws:ec2:RouteTable vpc-st-private-2 created (0.54s)
+ │ └─ aws:ec2:RouteTableAssociation vpc-st-private-2 created (0.33s)
+ ├─ aws:ec2:InternetGateway vpc-st created (0.63s)
+ ├─ aws:ec2:Subnet vpc-st-private-3 created (0.89s)
+ │ └─ aws:ec2:RouteTable vpc-st-private-3 created (0.51s)
+ │ └─ aws:ec2:RouteTableAssociation vpc-st-private-3 created (0.34s)
+ ├─ aws:ec2:Subnet vpc-st-private-1 created (0.90s)
+ │ └─ aws:ec2:RouteTable vpc-st-private-1 created (0.52s)
+ │ └─ aws:ec2:RouteTableAssociation vpc-st-private-1 created (0.34s)
+ ├─ aws:ec2:Subnet vpc-st-public-3 created (10s)
+ │ └─ aws:ec2:RouteTable vpc-st-public-3 created (0.47s)
+ │ ├─ aws:ec2:RouteTableAssociation vpc-st-public-3 created (1s)
+ │ └─ aws:ec2:Route vpc-st-public-3 created (0.57s)
+ └─ aws:ec2:Subnet vpc-st-public-2 created (11s)
+ └─ aws:ec2:RouteTable vpc-st-public-2 created (0.51s)
+ ├─ aws:ec2:RouteTableAssociation vpc-st-public-2 created (0.42s)
+ └─ aws:ec2:Route vpc-st-public-2 created (0.50s)
Here is the code:
import pulumi_aws.ec2
from pulumi import log
import pulumi_awsx
from aws.eks.base.const import VPC_NAME, CLUSTER_TAG, AVAILABILITY_ZONE_NAMES, VPC_NAMES, \
CIDR_BLOCKS, DEP_MODE
# VPC
def create_vpc(vpc_name=None, cidr_block=None):
log.info('[base.vpc.create_vpc]')
name = vpc_name or VPC_NAME
cidr_block = cidr_block or CIDR_BLOCKS[DEP_MODE]
vpc = pulumi_awsx.ec2.Vpc(
name,
cidr_block=cidr_block,
subnet_specs=[
pulumi_awsx.ec2.SubnetSpecArgs(
type=pulumi_awsx.ec2.SubnetType.PRIVATE,
tags={
CLUSTER_TAG: "owned",
'kubernetes.io/role/internal-elb': '1',
'vpc': f'{name}',
},
),
pulumi_awsx.ec2.SubnetSpecArgs(
type=pulumi_awsx.ec2.SubnetType.PUBLIC,
tags={
CLUSTER_TAG: "owned",
'kubernetes.io/role/elb': '1',
'vpc': f'{name}',
},
),
],
availability_zone_names=AVAILABILITY_ZONE_NAMES,
nat_gateways=pulumi_awsx.ec2.NatGatewayConfigurationArgs(
strategy=pulumi_awsx.ec2.NatGatewayStrategy.NONE,
),
tags={"Name": name},
)
return vpc
stocky-restaurant-98004
10/04/2023, 6:17 PMdamp-salesmen-74351
10/04/2023, 6:56 PM'<http://kubernetes.io/role/elb|kubernetes.io/role/elb>': '1'
and
nat_gateways=pulumi_awsx.ec2.NatGatewayConfigurationArgs(
strategy=pulumi_awsx.ec2.NatGatewayStrategy.SINGLE,
)
stocky-restaurant-98004
10/04/2023, 8:32 PMdamp-salesmen-74351
10/04/2023, 9:53 PMstrategy=pulumi_awsx.ec2.NatGatewayStrategy.ONE_PER_AZ
,
It tries to create three public Elastic IPs.216.239.36.21
216.239.38.21
216.239.32.21
216.239.34.21
• https://artifacthub.io/packages/helm/aws/aws-load-balancer-controller
• https://github.com/kubernetes-sigs/aws-load-balancer-controller/