late-account-9966
12/15/2023, 11:18 PMdry-keyboard-94795
12/15/2023, 11:43 PMdry-keyboard-94795
12/15/2023, 11:44 PMlate-account-9966
12/16/2023, 5:57 AMlate-account-9966
12/16/2023, 10:32 AMdry-keyboard-94795
12/16/2023, 10:32 AMlate-account-9966
12/17/2023, 10:03 PMpulumi:pulumi:Stack aws-infra-stage
├─ pulumi:providers:aws aws-useast2
├─ awsx:ec2:Vpc stage-vpc (URN: urn:pulumi:stage::aws-infra::awsx:ec2:Vpc::stage-vpc)
│ └─ aws:ec2/vpc:Vpc stage-vpc
and I want to end up with
pulumi:pulumi:Stack aws-infra-stage
+ ├─ kubetree:platform:VPC stage
+ │ └─ awsx:ec2:Vpc stage-vpc
+ │ └─ aws:ec2:Vpc stage-vpc
My ComponentResource class looks like:
...
class VPC(ComponentResource):
def __init__(self, name : str, cidr_block: str, aws_provider: aws.Provider, vpc_id : str=None, opts=None):
super().__init__('kubetree:platform:VPC', name, {}, opts)
self.opts = ??
with a method:
def create_vpc(self, tags)
vpcx = awsx.ec2.Vpc(f"{name}-vpc",
enable_dns_hostnames=True,
enable_dns_support=True,
cidr_block=cidr_block,
subnet_specs=subnet_specs,
nat_gateways=nat_gateway_conf,
tags=tags,
opts=pulumi.ResourceOptions(??)
late-account-9966
12/17/2023, 11:04 PMaliases=[pulumi.Alias(parent=pulumi.ROOT_STACK_RESOURCE),'urn:pulumi:stage::aws-infra::awsx:ec2:Vpc::stage-vpc']
for the opts in the call to vpcx = awsx.ec2.Vpc()
and it now looks like :
pulumi:pulumi:Stack aws-infra-stage
│ URN: urn:pulumi:stage::aws-infra::pulumi:pulumi:Stack::aws-infra-stage
├─ pulumi:providers:aws aws-useast2
│ URN: urn:pulumi:stage::aws-infra::pulumi:providers:aws::aws-useast2
├─ kubetree:platform:VPC stage
│ URN: urn:pulumi:stage::aws-infra::kubetree:platform:VPC::stage
├─ awsx:ec2:Vpc stage-vpc
│ │ URN: urn:pulumi:stage::aws-infra::awsx:ec2:Vpc::stage-vpc
without any of the resources under "urnpulumistage:aws infraawsxec2Vpc:stage-vpc" changing. Yay! Now I just need to reparent "urnpulumistage:aws infraawsxec2Vpc:stage-vpc" to be under "urnpulumistage:aws infrakubetreeplatformVPC:stage"
Is that possible? Thanks