glamorous-holiday-93698
07/16/2024, 2:23 AMname = "my-cluster"
cluster = aws.eks.Cluster(
name,
name=name,
role_arn=cluster_role_arn,
vpc_config={
"subnetIds": subnet_ids,
"securityGroupIds": [args.security_group_id],
},
tags=args.tags,
opts=opts,
)
My goal is to override cluster name because i want it to be unique and that’s exactly what i’m doing with name=name
(and it works), that’s the whole point of any resource in the cloud, devops must insure that resources are unique, and I’m using for example eks unique name without any random numbers in the end so I could comfortably use kubectl and awscli when referring cluster.
Problem: I can’t get the name of the cluster by calling this: cluster.name
and cluster.cluster.name
doesn’t work. Reason I need it is for addons. I’m provisioning my cluster in separate state and even using a package for that. Passing single object is comfortable. Currently I’m passing two args (one is cluster object and one is cluster_name) which is not very nice.
And another question would be how do I form the kubeconfig out of this object. eks.cluster() has this luxury, aws.eks.cluster - doesn’t.little-cartoon-10569
07/16/2024, 2:35 AMglamorous-holiday-93698
07/16/2024, 2:36 AMlittle-cartoon-10569
07/16/2024, 2:38 AMglamorous-holiday-93698
07/16/2024, 2:39 AMlittle-cartoon-10569
07/16/2024, 2:40 AMglamorous-holiday-93698
07/16/2024, 2:40 AMglamorous-holiday-93698
07/16/2024, 2:40 AMglamorous-holiday-93698
07/16/2024, 2:41 AMlittle-cartoon-10569
07/16/2024, 2:41 AMglamorous-holiday-93698
07/16/2024, 2:41 AMlittle-cartoon-10569
07/16/2024, 2:42 AMglamorous-holiday-93698
07/16/2024, 2:42 AMglamorous-holiday-93698
07/16/2024, 2:43 AMglamorous-holiday-93698
07/16/2024, 2:43 AMlittle-cartoon-10569
07/16/2024, 2:44 AMglamorous-holiday-93698
07/16/2024, 2:44 AMlittle-cartoon-10569
07/16/2024, 2:44 AMlittle-cartoon-10569
07/16/2024, 2:44 AMglamorous-holiday-93698
07/16/2024, 2:44 AMglamorous-holiday-93698
07/16/2024, 2:44 AMlittle-cartoon-10569
07/16/2024, 2:45 AMglamorous-holiday-93698
07/16/2024, 2:45 AMglamorous-holiday-93698
07/16/2024, 2:45 AMlittle-cartoon-10569
07/16/2024, 2:45 AMlittle-cartoon-10569
07/16/2024, 2:47 AMglamorous-holiday-93698
07/16/2024, 2:47 AMglamorous-holiday-93698
07/16/2024, 2:47 AMglamorous-holiday-93698
07/16/2024, 2:47 AMlittle-cartoon-10569
07/16/2024, 2:47 AMpulumi up
or pulumi preview
, the engine is run again.glamorous-holiday-93698
07/16/2024, 2:47 AMlittle-cartoon-10569
07/16/2024, 2:47 AMlittle-cartoon-10569
07/16/2024, 2:48 AMglamorous-holiday-93698
07/16/2024, 2:48 AMinfra/eks
i’m registering the output, cluster object: # Export the EKS cluster object
pulumi.export('cluster', eks_cluster.cluster)
little-cartoon-10569
07/16/2024, 2:48 AMglamorous-holiday-93698
07/16/2024, 2:48 AMinfra/eks_utils
i’m getting the object:
eks_stack = pulumi.StackReference("organization/infra-eks/dev")
# You can optionally use any output from infra-eks here
cluster = eks_stack.get_output("cluster")
little-cartoon-10569
07/16/2024, 2:49 AMglamorous-holiday-93698
07/16/2024, 2:49 AMglamorous-holiday-93698
07/16/2024, 2:49 AMglamorous-holiday-93698
07/16/2024, 2:49 AMlittle-cartoon-10569
07/16/2024, 2:49 AMglamorous-holiday-93698
07/16/2024, 2:49 AMlittle-cartoon-10569
07/16/2024, 2:50 AMglamorous-holiday-93698
07/16/2024, 2:50 AMglamorous-holiday-93698
07/16/2024, 2:50 AMglamorous-holiday-93698
07/16/2024, 2:51 AMlittle-cartoon-10569
07/16/2024, 2:51 AMglamorous-holiday-93698
07/16/2024, 2:51 AMlittle-cartoon-10569
07/16/2024, 2:51 AMThe ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud.
little-cartoon-10569
07/16/2024, 2:51 AMglamorous-holiday-93698
07/16/2024, 2:51 AMglamorous-holiday-93698
07/16/2024, 2:51 AMlittle-cartoon-10569
07/16/2024, 2:52 AMglamorous-holiday-93698
07/16/2024, 2:52 AMglamorous-holiday-93698
07/16/2024, 2:52 AMlittle-cartoon-10569
07/16/2024, 2:52 AMAll input properties are implicitly available as output properties.And name is an input.
glamorous-holiday-93698
07/16/2024, 2:53 AMlittle-cartoon-10569
07/16/2024, 2:53 AMglamorous-holiday-93698
07/16/2024, 2:53 AMglamorous-holiday-93698
07/16/2024, 2:54 AMlittle-cartoon-10569
07/16/2024, 2:54 AMlittle-cartoon-10569
07/16/2024, 2:54 AMglamorous-holiday-93698
07/16/2024, 2:54 AMglamorous-holiday-93698
07/16/2024, 2:55 AMglamorous-holiday-93698
07/16/2024, 2:55 AMglamorous-holiday-93698
07/16/2024, 2:55 AMlittle-cartoon-10569
07/16/2024, 2:55 AMlittle-cartoon-10569
07/16/2024, 2:56 AMlittle-cartoon-10569
07/16/2024, 2:56 AMglamorous-holiday-93698
07/16/2024, 2:57 AMglamorous-holiday-93698
07/16/2024, 2:57 AMglamorous-holiday-93698
07/16/2024, 2:57 AMlittle-cartoon-10569
07/16/2024, 2:57 AMglamorous-holiday-93698
07/16/2024, 2:58 AMlittle-cartoon-10569
07/16/2024, 2:58 AMglamorous-holiday-93698
07/16/2024, 3:00 AMglamorous-holiday-93698
07/16/2024, 3:00 AMglamorous-holiday-93698
07/16/2024, 3:00 AMglamorous-holiday-93698
07/16/2024, 3:00 AMlittle-cartoon-10569
07/16/2024, 3:01 AMglamorous-holiday-93698
07/16/2024, 3:01 AMlittle-cartoon-10569
07/16/2024, 3:01 AMglamorous-holiday-93698
07/16/2024, 3:01 AMglamorous-holiday-93698
07/16/2024, 3:01 AMlittle-cartoon-10569
07/16/2024, 3:01 AMglamorous-holiday-93698
07/16/2024, 3:02 AMlittle-cartoon-10569
07/16/2024, 3:02 AMglamorous-holiday-93698
07/16/2024, 3:03 AMglamorous-holiday-93698
07/16/2024, 3:05 AMmyproject/
├── dev # dev got own vpc
│ └── vpc
│ └── Pulumi.yaml
├── infra
│ ├── eks
│ │ ├── Pulumi.dev.yaml # eks params for dev
│ │ ├── Pulumi.stag.yaml # eks params for stag
│ │ └── Pulumi.yaml
│ ├── eks_utils # splitting provisioning
│ │ ├── Pulumi.dev.yaml
│ │ ├── Pulumi.stag.yaml
│ │ └── Pulumi.yaml
│ └── vpc # infra got own vpc, peering will be used
│ ├── Pulumi.dev.yaml
│ └── Pulumi.yaml
└── packages
└── eks_utils # package for reusing default stuff
little-cartoon-10569
07/16/2024, 4:39 AMglamorous-holiday-93698
07/16/2024, 8:40 AMglamorous-holiday-93698
07/16/2024, 8:41 AMpulumi up
would be ideal.