You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
variable"another_uid" {
default="xxxx"
}
# Method 1: Use assume_role to operate resources in the target cen account, detail see https://registry.terraform.io/providers/aliyun/alicloud/latest/docs#assume-roleprovider"alicloud" {
region="cn-hangzhou"alias="child_account"assume_role {
role_arn="acs:ram::${var.another_uid}:role/terraform-example-assume-role"
}
}
# Method 2: Use the target cen account's access_key, secret_key# provider "alicloud" {# region = "cn-hangzhou"# access_key = "access_key"# secret_key = "secret_key"# alias = "child_account"# }provider"alicloud" {
alias="your_account"
}
data"alicloud_account""your_account" {
provider=alicloud.your_account
}
data"alicloud_account""child_account" {
provider=alicloud.child_account
}
data"alicloud_regions""default" {
current=true
}
resource"alicloud_cen_instance""example" {
provider=alicloud.your_accountcen_instance_name="tf_example"description="an example for cen"
}
resource"alicloud_vpc""child_account" {
provider=alicloud.child_accountvpc_name="terraform-example"cidr_block="172.17.3.0/24"
}
resource"alicloud_cen_instance_grant""child_account" {
provider=alicloud.child_accountcen_id=alicloud_cen_instance.example.idchild_instance_id=alicloud_vpc.child_account.idcen_owner_id=data.alicloud_account.your_account.id
}
resource"alicloud_cen_instance_attachment""example" {
provider=alicloud.your_accountinstance_id=alicloud_cen_instance.example.idchild_instance_id=alicloud_cen_instance_grant.child_account.child_instance_idchild_instance_type="VPC"child_instance_region_id=data.alicloud_regions.default.regions.0.idchild_instance_owner_id=data.alicloud_account.child_account.id
}
Converting this snippet yields:
warning: /Users/t0yv0/bugs/ci-mgmt-889/repro-comments/first-class-provider/ali_cen.tf:5,1-20: Provider alias not supported; Provider aliases are not supported, ignoring alicloud=child_account
warning: /Users/t0yv0/bugs/ci-mgmt-889/repro-comments/first-class-provider/ali_cen.tf:21,1-20: Provider alias not supported; Provider aliases are not supported, ignoring alicloud=your_account
Consider supporting.
Also as a side note, introducing the new converter removed comments here, so presumably comments are no longer supported; for this example it might be fine since comments have more TF in them that didn't get converted before. Regarding aliases, prior to the converter we had some incorrect Provider options generated but that's now gone so looks like an improvement. Thank you!
Affected area/feature
The text was updated successfully, but these errors were encountered:
Hello!
Issue details
Converting this snippet yields:
Consider supporting.
Also as a side note, introducing the new converter removed comments here, so presumably comments are no longer supported; for this example it might be fine since comments have more TF in them that didn't get converted before. Regarding aliases, prior to the converter we had some incorrect Provider options generated but that's now gone so looks like an improvement. Thank you!
Affected area/feature
The text was updated successfully, but these errors were encountered: