Hello, I have a problem creating a k8s deploy. I c...
# general
b
Hello, I have a problem creating a k8s deploy. I currently have a cluster and a nodegroup that I created with pulumi_eks
Copy code
### CREATE CLUSTER ###
        for i in range(data_conf["eks_cluster"].__len__()):
            data_conf["eks_cluster"][i].update(
                {
                    "vpc_id": vpc.id,
                    "public_subnet_ids": [subnet.id for subnet in public_subnets],
                    "cluster_security_group": public_sg[i], # NOTE: expected 1 SG * Cluster
                    "instance_roles": cluster_node_role
                }
            )

        clusters = CreateEksClusterB.pulumi_builder(data_conf=data_conf)
       

        ## CREATE NODEGROUP ###
        for i in range(data_conf["eks_nodegroup"].__len__()):
            data_conf["eks_nodegroup"][i].update(
                {
                    "cluster": clusters[0],
                    "node_security_group": clusters[0].node_security_group,
                    "node_subnet_ids": [subnet.id for subnet in public_subnets],
                    "cluster_ingress_rule": public_sg[i],
                    "instance_profile": instance_profiles[i]
                }
            )

        nodegroups = CreateEksNodeGroupB.pulumi_builder(data_conf=data_conf)
but when I want to do a k8s Deploy I get an error: Program failed with an unhandled exception: Exception: an instanceProfile is required However, I am sending the instance profile in k,v {"instance_profile": instance_profiles[i]} let me show u the outputs
Copy code
Type                                   Name                                             Status                  Info
 +   pulumi:pulumi:Stack                    Testing-k8s-testing                              **creating failed**     2 errors; 3 messages
 +   ├─ custom:resource:VPC                 VPC                                              created (2s)            
 +   │  └─ aws:ec2:Vpc                      vpc-eksvpc2-nonprod-use1-117                     created (12s)           
 +   ├─ custom:resource:IGATEWAY            IGW-eksvpc2                                      created (5s)            
 +   │  └─ aws:ec2:InternetGateway          igw-eksvpc2-nonprod-use1                         created (0.87s)         
 +   ├─ custom:resource:SUBNET              PUB_SUBNET_2                                     created (5s)            
 +   │  └─ aws:ec2:Subnet                   pubsub-2-eksvpc2-nonprod-use1b-117-30            created (12s)           
 +   ├─ custom:resource:ROUTETABLE          PUB_ROUTE_TABLE_1                                created (5s)            
 +   │  └─ aws:ec2:RouteTable               pub-rt1-eksvpc2-nonprod-use1                     created (1s)            
 +   ├─ custom:resource:ROUTE               PUB_ROUTE_1                                      created (6s)            
 +   │  └─ aws:ec2:Route                    pub-route-eksvpc2-nonprod-1                      created (0.79s)         
 +   ├─ custom:resource:RTTABLEASSOC        PUB_RTASSOC1                                     created (6s)            
 +   │  └─ aws:ec2:RouteTableAssociation    pub-rtassoc0-eksvpc2-nonprod                     created (0.93s)         
 +   ├─ custom:resource:SUBNET              PUB_SUBNET_1                                     created (6s)            
 +   │  └─ aws:ec2:Subnet                   pubsub-1-eksvpc2-nonprod-use1a-117-94            created (11s)           
 +   ├─ custom:resource:SECGROUP            WEBSERVER-SECGROUP_1                             created (6s)            
 +   │  └─ aws:ec2:SecurityGroup            secgroup-webserver-eksvpc2-nonprod-use1          created (3s)            
 +   ├─ custom:resource:RTTABLEASSOC        PUB_RTASSOC2                                     created (7s)            
 +   │  └─ aws:ec2:RouteTableAssociation    pub-rtassoc1-eksvpc2-nonprod                     created (0.90s)         
 +   ├─ custom:resource:ROLE                CLUSTER-NODE_ROLE_1-EKSVPC2                      created (7s)            
 +   │  └─ aws:iam:Role                     role1-cluster-node-eksvpc2-nonprod               created (1s)            
 +   ├─ custom:resource:ROLEPOLICYATTACH    ROLE_POLICY_ATTACH_CLUSTER_2                     created (1s)            
 +   │  └─ aws:iam:RolePolicyAttachment     rpolicy-cluster-2-eksvpc2-nonprod                created (0.42s)         
 +   ├─ custom:resource:ROLEPOLICYATTACH    ROLE_POLICY_ATTACH_CLUSTER_1                     created (3s)            
 +   │  └─ aws:iam:RolePolicyAttachment     rpolicy-cluster-1-eksvpc2-nonprod                created (1s)            
 +   ├─ custom:resource:ROLEPOLICYATTACH    ROLE_POLICY_ATTACH_CLUSTER_3                     created (4s)            
 +   │  └─ aws:iam:RolePolicyAttachment     rpolicy-cluster-3-eksvpc2-nonprod                created (1s)            
 +   ├─ custom:resource:ROLEPOLICYATTACH    ROLE_POLICY_ATTACH_CLUSTER_5                     created (5s)            
 +   │  └─ aws:iam:RolePolicyAttachment     rpolicy-cluster-5-eksvpc2-nonprod                created (1s)            
 +   ├─ custom:resource:INSTANCE_PROFILE    INSTANCE_PROFILE_NODE_1                          created (6s)            
 +   │  └─ aws:iam:InstanceProfile          iprofile-1-ec2node-eksvpc2-nonprod               created (1s)            
 +   ├─ custom:resource:ROLEPOLICYATTACH    ROLE_POLICY_ATTACH_CLUSTER_4                     created (6s)            
 +   │  └─ aws:iam:RolePolicyAttachment     rpolicy-cluster-4-eksvpc2-nonprod                created (0.62s)         
 +   ├─ custom:resource:NODEGROUP           NODEGROUP_1_EKSVPC2                              created (7s)            
 +   ├─ custom:resource:PROVIDER            PROVIDER_EKSVPC2                                 created (7s)            
 +   └─ eks:index:Cluster                   CLUSTER_1_EKSVPC2_NONPROD_117                    created                 
 +      ├─ eks:index:ServiceRole            CLUSTER_1_EKSVPC2_NONPROD_117-eksRole            created (2s)            
 +      │  ├─ aws:iam:Role                  CLUSTER_1_EKSVPC2_NONPROD_117-eksRole-role       created (0.68s)         
 +      │  └─ aws:iam:RolePolicyAttachment  CLUSTER_1_EKSVPC2_NONPROD_117-eksRole-4b490823   created (0.44s)         
 +      ├─ eks:index:RandomSuffix           CLUSTER_1_EKSVPC2_NONPROD_117-cfnStackName       created (0.44s)         
 +      ├─ aws:eks:Cluster                  CLUSTER_1_EKSVPC2_NONPROD_117-eksCluster         created (585s)          
 +      ├─ aws:ec2:SecurityGroup            CLUSTER_1_EKSVPC2_NONPROD_117-nodeSecurityGroup  created (2s)            
 +      ├─ eks:index:VpcCni                 CLUSTER_1_EKSVPC2_NONPROD_117-vpc-cni            created (2s)            
 +      └─ pulumi:providers:kubernetes      CLUSTER_1_EKSVPC2_NONPROD_117-eks-k8s            created (0.37s)
b
what is the value of
instance_profiles[i]
- can you print it? can you verify it’s actually in the state diff? It’s likely that it’s an empty value
b
sorry I was busy with university works. At the preview export it has
Copy code
i_profile:                    : {
        @isPulumiResource: true
        arn              : output<string>
        create_date      : output<string>
        id               : output<string>
        name             : "iprofile-1-ec2node-eksvpc2-nonprod-ac60974"
        name_prefix      : output<string>
        path             : "/"
        role             : output<string>
        tags             : {
            Cloudbuddies Archie: "Cloudbuddies"
            Department         : ""
            Environment        : "nonprod"
            Name               : "iprofile-1-ec2node-eksvpc2-nonprod"
            Project            : "eksvpc2"
        }
        tags_all         : output<string>
        unique_id        : output<string>
        urn              : "urn:pulumi:k8s-testing::Testing::custom:resource:INSTANCE_PROFILE$aws:iam/instanceProfile:InstanceProfile::iprofile-1-ec2node-eksvpc2-nonprod"
    }