gator1 / terraform-provider-opentelekomcloud

Terraform opentelekomcloud provider
Mozilla Public License 2.0
5 stars 3 forks source link

Change 'records' attribute of dns recordset resource to Set type #18

Open huangtianhua opened 6 years ago

gator1 commented 6 years ago

sounds like your changes cause Tom to have problem, see what he reported in the issues section. Please test and write an article explaining what happened. He just used the sample tf I provided and I know it was working before.

When you put a PR, please provide a description as why it's changed. Why do you change it to a set? What's the motivation. If it's a customer issue or test issue, explain the issue and how your change fix the issue.

On Mon, Jan 15, 2018 at 12:10 AM, huangtianhua notifications@github.com wrote:


You can view, comment on, or merge this pull request online at:

https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18 Commit Summary

  • Merge pull request #1 from gator1/master
  • Merge pull request #2 from gator1/master
  • Modify "records" type to Set to avoid unnecessary change

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ATBNFR09mmcDi7gpJTW9sgEIK_9w78clks5tKwfigaJpZM4ReC76 .

gator1 commented 6 years ago

https://github.com/gator1/terraform-provider-opentelekomcloud/issues

On Mon, Jan 15, 2018 at 12:34 PM, Gary Xia garyxia@gmail.com wrote:

sounds like your changes cause Tom to have problem, see what he reported in the issues section. Please test and write an article explaining what happened. He just used the sample tf I provided and I know it was working before.

When you put a PR, please provide a description as why it's changed. Why do you change it to a set? What's the motivation. If it's a customer issue or test issue, explain the issue and how your change fix the issue.

On Mon, Jan 15, 2018 at 12:10 AM, huangtianhua notifications@github.com wrote:


You can view, comment on, or merge this pull request online at:

https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18 Commit Summary

  • Merge pull request #1 from gator1/master
  • Merge pull request #2 from gator1/master
  • Modify "records" type to Set to avoid unnecessary change

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ATBNFR09mmcDi7gpJTW9sgEIK_9w78clks5tKwfigaJpZM4ReC76 .

huangtianhua commented 6 years ago

@Gary, Sorry to reply too late, I took tests for the dns record set resource again, and can’t reproduce the issue, I have wrote the comment in issue/19 page. IIUC, the attribute output of a resource can be got if the resource is created successful and also we set the attribute for the resource. I didn’t change anything for record set resource to cause the problem that Tom met.

发件人: Gary Xia [mailto:notifications@github.com] 发送时间: 2018年1月16日 4:35 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

sounds like your changes cause Tom to have problem, see what he reported in the issues section. Please test and write an article explaining what happened. He just used the sample tf I provided and I know it was working before.

When you put a PR, please provide a description as why it's changed. Why do you change it to a set? What's the motivation. If it's a customer issue or test issue, explain the issue and how your change fix the issue.

On Mon, Jan 15, 2018 at 12:10 AM, huangtianhua notifications@github.com<mailto:notifications@github.com> wrote:


You can view, comment on, or merge this pull request online at:

https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18 Commit Summary

  • Merge pull request #1 from gator1/master
  • Merge pull request #2 from gator1/master
  • Modify "records" type to Set to avoid unnecessary change

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ATBNFR09mmcDi7gpJTW9sgEIK_9w78clks5tKwfigaJpZM4ReC76 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-357783423, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYAqn-7JsFFxSXsXi4VKClC5rYaH1ks5tK7ZtgaJpZM4ReC76.

huangtianhua commented 6 years ago

About the pr18, I wrote the issue description in commit message:

Modify "records" type to Set to avoid unnecessary change Execute cmd 'terraform plan' after a dns recordset created, we see that something will be changed, even if there is nothing changed, like:

Terraform will perform the following actions:

~ opentelekomcloud_dns_recordset_v2.hth_private_zone_record records.0: "10.1.0.7" => "10.1.0.6" records.1: "10.1.0.6" => "10.1.0.7"

Change "records" type from List to Set to avoid this.

可能我英语表达的不太好:执行完terraform apply以后,dns recordset资源创建成功,但是模板没有任何修改的情况下,执行terraform plan会发现 Terraform认为有变化: ~ opentelekomcloud_dns_recordset_v2.hth_private_zone_record records.0: "10.1.0.7" => "10.1.0.6" records.1: "10.1.0.6" => "10.1.0.7"

这个是由于records是List的缘故,应该改为Set,你可以自己测试一下,多谢。

发件人: Gary Xia [mailto:notifications@github.com] 发送时间: 2018年1月16日 4:36 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

https://github.com/gator1/terraform-provider-opentelekomcloud/issues

On Mon, Jan 15, 2018 at 12:34 PM, Gary Xia garyxia@gmail.com<mailto:garyxia@gmail.com> wrote:

sounds like your changes cause Tom to have problem, see what he reported in the issues section. Please test and write an article explaining what happened. He just used the sample tf I provided and I know it was working before.

When you put a PR, please provide a description as why it's changed. Why do you change it to a set? What's the motivation. If it's a customer issue or test issue, explain the issue and how your change fix the issue.

On Mon, Jan 15, 2018 at 12:10 AM, huangtianhua notifications@github.com<mailto:notifications@github.com> wrote:


You can view, comment on, or merge this pull request online at:

https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18 Commit Summary

  • Merge pull request #1 from gator1/master
  • Merge pull request #2 from gator1/master
  • Modify "records" type to Set to avoid unnecessary change

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gator1/terraform-provider-opentelekomcloud/pull/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ATBNFR09mmcDi7gpJTW9sgEIK_9w78clks5tKwfigaJpZM4ReC76 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-357783685, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYCf05gOpqtWk4Zsqta2pDAdc30tTks5tK7bDgaJpZM4ReC76.

Tom-Mann commented 6 years ago

Thanks guys for investigating. For me it’s not working and the dns record is created successfully. I have created a test for you to reproduce, one question I have is are you using modules for the testing ?

environment file

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

Module file

creates the DNS record

resource "openstack_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${openstack_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

Apply complete! Resources: 3 added, 0 changed, 0 destroyed. [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist. [linux@bastion02az02 TSystems]$ terraform refresh opentelekomcloud_blockstorage_volume_v2.test1OSvolume: Refreshing state... (ID: eb037f14-3c00-405b-8591-259ec14e7522) opentelekomcloud_compute_instance_v2.test1: Refreshing state... (ID: f49ae4a1-724f-4760-804f-312ca41424e6) openstack_dns_recordset_v2.test1_dns: Refreshing state... (ID: ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a0160fe39d1ee0550) [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist.

Venlig hilsen

Thomas Richard Mann

huangtianhua commented 6 years ago

No, I didn’t use modules for testing. Does it matter? Why the recordset type is "openstack_dns_recordset_v2", it should be "opentelekomcloud _dns_recordset_v2", right? Or I missed something?

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月16日 17:15 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Thanks guys for investigating. For me it’s not working and the dns record is created successfully. I have created a test for you to reproduce, one question I have is are you using modules for the testing ?

environment file

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

Module file

creates the DNS record

resource "openstack_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${openstack_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

Apply complete! Resources: 3 added, 0 changed, 0 destroyed. [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist. [linux@bastion02az02 TSystems]$ terraform refresh opentelekomcloud_blockstorage_volume_v2.test1OSvolume: Refreshing state... (ID: eb037f14-3c00-405b-8591-259ec14e7522) opentelekomcloud_compute_instance_v2.test1: Refreshing state... (ID: f49ae4a1-724f-4760-804f-312ca41424e6) openstack_dns_recordset_v2.test1_dns: Refreshing state... (ID: ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a0160fe39d1ee0550) [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist.

Venlig hilsen

Thomas Richard Mann

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-357898424, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYIOCfSjISRurPKkzUmaIcH99nefsks5tLGiegaJpZM4ReC76.

Tom-Mann commented 6 years ago

Thanks, Let me test with the opentelekom object, it’s purely a remnant of when you didn’t have the dns object and I was told you are just extending the object so shouldn’t have issues.

Tom-Mann commented 6 years ago

I’ve just retested with the opentelekom dns recordset and it makes no difference. Still no output.

Apply complete! Resources: 1 added, 0 changed, 1 destroyed. [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist. [linux@bastion02az02 TSystems]$ terraform refresh opentelekomcloud_blockstorage_volume_v2.test1OSvolume: Refreshing state... (ID: eb037f14-3c00-405b-8591-259ec14e7522) opentelekomcloud_compute_instance_v2.test1: Refreshing state... (ID: f49ae4a1-724f-4760-804f-312ca41424e6) opentelekomcloud_dns_recordset_v2.test1_dns: Refreshing state... (ID: ff8080825d7c8ef1015e08e52f652399/ff80808260e9a4330160fe79fba70520) [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist.

Venlig hilsen

Thomas Richard Mann

huangtianhua commented 6 years ago

Sorry, I still can’t reproduce this problem.

  1. So could you check the repo is gator1/terraform-provider-opentelekomcloud and the code is latest or in which commit?
  2. And could you give all tf configuration file you used?
  3. Could you show the state file?

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月16日 18:21 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

I’ve just retested with the opentelekom dns recordset and it makes no difference. Still no output.

Apply complete! Resources: 1 added, 0 changed, 1 destroyed. [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist. [linux@bastion02az02 TSystems]$ terraform refresh opentelekomcloud_blockstorage_volume_v2.test1OSvolume: Refreshing state... (ID: eb037f14-3c00-405b-8591-259ec14e7522) opentelekomcloud_compute_instance_v2.test1: Refreshing state... (ID: f49ae4a1-724f-4760-804f-312ca41424e6) opentelekomcloud_dns_recordset_v2.test1_dns: Refreshing state... (ID: ff8080825d7c8ef1015e08e52f652399/ff80808260e9a4330160fe79fba70520) [linux@bastion02az02 TSystems]$ terraform output The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the output keyword and run terraform refresh for it to become available. If you are using interpolation, please verify the interpolated value is not empty. You can use the terraform console command to assist.

Venlig hilsen

Thomas Richard Mann

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-357916075, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYIQLnrBY7otEyCwnx2xc74GBIPa0ks5tLHgbgaJpZM4ReC76.

gator1 commented 6 years ago

Your change is not in. You can't have a request to master branch. It has to be in the integration branch so that I have a chance to run test.

Tom-Mann commented 6 years ago

Afternoon, Thanks for getting back to me, I downloaded from git on the 15th of Jan so 2 days ago. I can download and rebuild if you have added fixes since then. Code is below again (not allowed to provide the vars file) as is state

environment file

variable "OS_PASSWORD" { description = "The password to login with" }

variable "OS_USERNAME" { description = "The Username to login with" }

variable "OS_DOMAIN" { description = "The Domain Name to use" }

provider "opentelekomcloud" { user_name = "${var.OS_USERNAME}" password = "${var.OS_PASSWORD}" tenant_name = "eu-de" domain_name = "${var.OS_DOMAIN}" auth_url = "https://iam.eu-de.otc.t-systems.com:443/v3" }

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

module.

creates the DNS record

resource "opentelekomcloud_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${opentelekomcloud_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

State File

{ "version": 3, "terraform_version": "0.10.8", "serial": 27, "lineage": "716d7c9a-79c0-43cc-a2fa-e200c4b9b93d", "modules": [ { "path": [ "root" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "Tester" ], "outputs": { "test1_dns_output": { "sensitive": false, "type": "string", "value": "issuetest1.test.test.net." } }, "resources": { "opentelekomcloud_blockstorage_volume_v2.test1OSvolume": { "type": "opentelekomcloud_blockstorage_volume_v2", "depends_on": [], "primary": { "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "attributes": { "attachment.#": "0", "availability_zone": "eu-de-02", "description": "", "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "image_id": "732b56f0-57d9-4b5b-8c9a-5bd8c8b76901", "metadata.%": "0", "name": "Issuetest1.test-OSdisk01", "region": "", "size": "30", "snapshot_id": "", "source_vol_id": "", "volume_type": "SATA" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_compute_instance_v2.test1": { "type": "opentelekomcloud_compute_instance_v2", "depends_on": [ "opentelekomcloud_blockstorage_volume_v2.test1OSvolume." ], "primary": { "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "attributes": { "access_ip_v4": "10.62.81.153", "access_ip_v6": "", "all_metadata.%": "0", "availability_zone": "eu-de-02", "block_device.#": "1", "block_device.0.boot_index": "0", "block_device.0.delete_on_termination": "true", "block_device.0.destination_type": "volume", "block_device.0.guest_format": "", "block_device.0.source_type": "volume", "block_device.0.uuid": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "block_device.0.volume_size": "0", "flavor_id": "computev2-6", "flavor_name": "c2.8xlarge", "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "image_id": "Attempt to boot from volume - no image supplied", "key_pair": "KeyPair-7278", "name": "Issuetest1.test.test.net", "network.#": "1", "network.0.access_network": "false", "network.0.fixed_ip_v4": "10.62.81.153", "network.0.fixed_ip_v6": "", "network.0.floating_ip": "", "network.0.mac": "fa:16:3e:e8:18:8c", "network.0.name": "768910a5-5478-4e11-a01f-cc00eac060e3", "network.0.port": "", "network.0.uuid": "c33fcf0b-6128-43c2-bd47-9d41752db0d3", "region": "", "security_groups.#": "1", "security_groups.3814588639": "default", "stop_before_destroy": "false", "tags.#": "0" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 1800000000000, "delete": 1800000000000, "update": 1800000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_dns_recordset_v2.test1_dns": { "type": "opentelekomcloud_dns_recordset_v2", "depends_on": [ "opentelekomcloud_compute_instance_v2.test1." ], "primary": { "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "attributes": { "description": "", "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "name": "issuetest1.test.test.net.", "records.#": "1", "records.0": "10.62.81.153", "region": "", "ttl": "300", "type": "A", "zone_id": "ff8080825d7c8ef1015e08e52f652399" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000, "update": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" } }, "depends_on": [] }, { "path": [ "root", "Training" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "accessControlLists" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az01" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az02" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "grid-server" ], "outputs": {}, "resources": {}, "depends_on": [] } ] }

Venlig hilsen

Thomas Richard Mann

huangtianhua commented 6 years ago

Sorry I am not familiar with Module usage, so I read the docs again, and about the terraform output: https://www.terraform.io/docs/commands/output.html

Command: output The terraform output command is used to extract the value of an output variable from the state file. »https://www.terraform.io/docs/commands/output.html#usageUsage Usage: terraform output [options] [NAME] With no additional arguments, output will display all the outputs for the root module. If an output NAME is specified, only the value of that output is printed. The command-line flags are all optional. The list of available flags are:

So I guess you could get the output ‘test1_dns_output’ by cmd ‘terraform output –module=Tester’, try please, thank you.

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月17日 21:59 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Afternoon, Thanks for getting back to me, I downloaded from git on the 15th of Jan so 2 days ago. I can download and rebuild if you have added fixes since then. Code is below again (not allowed to provide the vars file) as is state

environment file

variable "OS_PASSWORD" { description = "The password to login with" }

variable "OS_USERNAME" { description = "The Username to login with" }

variable "OS_DOMAIN" { description = "The Domain Name to use" }

provider "opentelekomcloud" { user_name = "${var.OS_USERNAME}" password = "${var.OS_PASSWORD}" tenant_name = "eu-de" domain_name = "${var.OS_DOMAIN}" auth_url = "https://iam.eu-de.otc.t-systems.com:443/v3" }

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

module.

creates the DNS record

resource "opentelekomcloud_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${opentelekomcloud_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

State File

{ "version": 3, "terraform_version": "0.10.8", "serial": 27, "lineage": "716d7c9a-79c0-43cc-a2fa-e200c4b9b93d", "modules": [ { "path": [ "root" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "Tester" ], "outputs": { "test1_dns_output": { "sensitive": false, "type": "string", "value": "issuetest1.test.test.net." } }, "resources": { "opentelekomcloud_blockstorage_volume_v2.test1OSvolume": { "type": "opentelekomcloud_blockstorage_volume_v2", "depends_on": [], "primary": { "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "attributes": { "attachment.#": "0", "availability_zone": "eu-de-02", "description": "", "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "image_id": "732b56f0-57d9-4b5b-8c9a-5bd8c8b76901", "metadata.%": "0", "name": "Issuetest1.test-OSdisk01", "region": "", "size": "30", "snapshot_id": "", "source_vol_id": "", "volume_type": "SATA" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_compute_instance_v2.test1": { "type": "opentelekomcloud_compute_instance_v2", "depends_on": [ "opentelekomcloud_blockstorage_volume_v2.test1OSvolume." ], "primary": { "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "attributes": { "access_ip_v4": "10.62.81.153", "access_ip_v6": "", "all_metadata.%": "0", "availability_zone": "eu-de-02", "block_device.#": "1", "block_device.0.boot_index": "0", "block_device.0.delete_on_termination": "true", "block_device.0.destination_type": "volume", "block_device.0.guest_format": "", "block_device.0.source_type": "volume", "block_device.0.uuid": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "block_device.0.volume_size": "0", "flavor_id": "computev2-6", "flavor_name": "c2.8xlarge", "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "image_id": "Attempt to boot from volume - no image supplied", "key_pair": "KeyPair-7278", "name": "Issuetest1.test.test.net", "network.#": "1", "network.0.access_network": "false", "network.0.fixed_ip_v4": "10.62.81.153", "network.0.fixed_ip_v6": "", "network.0.floating_ip": "", "network.0.mac": "fa:16:3e:e8:18:8c", "network.0.name": "768910a5-5478-4e11-a01f-cc00eac060e3", "network.0.port": "", "network.0.uuid": "c33fcf0b-6128-43c2-bd47-9d41752db0d3", "region": "", "security_groups.#": "1", "security_groups.3814588639": "default", "stop_before_destroy": "false", "tags.#": "0" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 1800000000000, "delete": 1800000000000, "update": 1800000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_dns_recordset_v2.test1_dns": { "type": "opentelekomcloud_dns_recordset_v2", "depends_on": [ "opentelekomcloud_compute_instance_v2.test1." ], "primary": { "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "attributes": { "description": "", "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "name": "issuetest1.test.test.net.", "records.#": "1", "records.0": "10.62.81.153", "region": "", "ttl": "300", "type": "A", "zone_id": "ff8080825d7c8ef1015e08e52f652399" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000, "update": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" } }, "depends_on": [] }, { "path": [ "root", "Training" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "accessControlLists" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az01" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az02" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "grid-server" ], "outputs": {}, "resources": {}, "depends_on": [] } ] }

Venlig hilsen

Thomas Richard Mann

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358312141, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYPlg7qcO62PXYiiXgaGqgexEal61ks5tLfyJgaJpZM4ReC76.

Tom-Mann commented 6 years ago

Morning, Thanks for your email, as you say the command terraform output -module="Tester" correctly prints out the output. I’ll raise with the terraform project as ‘terraform output’ should print all outputs where as the modules flag should be a filter on that output. Thanks for your help with this

Venlig hilsen

Thomas Richard Mann

Nordea | Kronos Besøg mig: Grønjordsvej 10, 2300 København S Skriv til mig: Grønjordsvej 10, PO Box 850, 0900 København C Tlf: 55479990 | Mob: 23266418 E-mail: tom.mann@nordea.commailto:tom.mann@nordea.com Web: nordea.dkhttp://www.nordea.dk/

Nordea Danmark, filial af Nordea Bank AB (publ), Sverige, org.nr. 516406-0120, Bolagsverket, CVR-nr. 25992180, København

Denne e-mail kan indeholde fortrolige oplysninger. Hvis du fejlagtigt har modtaget denne e-mail, beder vi dig underrette afsenderen, slette e-mailen og undlade at dele eller kopiere den.

From: huangtianhua [mailto:notifications@github.com] Sent: Thursday, January 18, 2018 3:01 AM To: gator1/terraform-provider-opentelekomcloud terraform-provider-opentelekomcloud@noreply.github.com Cc: Mann, Tom Tom.Mann@nordea.com; Comment comment@noreply.github.com Subject: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Sorry I am not familiar with Module usage, so I read the docs again, and about the terraform output: https://www.terraform.io/docs/commands/output.html

Command: output The terraform output command is used to extract the value of an output variable from the state file. »https://www.terraform.io/docs/commands/output.html#usageUsage Usage: terraform output [options] [NAME] With no additional arguments, output will display all the outputs for the root module. If an output NAME is specified, only the value of that output is printed. The command-line flags are all optional. The list of available flags are:

So I guess you could get the output ‘test1_dns_output’ by cmd ‘terraform output –module=Tester’, try please, thank you.

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月17日 21:59 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Afternoon, Thanks for getting back to me, I downloaded from git on the 15th of Jan so 2 days ago. I can download and rebuild if you have added fixes since then. Code is below again (not allowed to provide the vars file) as is state

environment file

variable "OS_PASSWORD" { description = "The password to login with" }

variable "OS_USERNAME" { description = "The Username to login with" }

variable "OS_DOMAIN" { description = "The Domain Name to use" }

provider "opentelekomcloud" { user_name = "${var.OS_USERNAME}" password = "${var.OS_PASSWORD}" tenant_name = "eu-de" domain_name = "${var.OS_DOMAIN}" auth_url = "https://iam.eu-de.otc.t-systems.com:443/v3" }

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

module.

creates the DNS record

resource "opentelekomcloud_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${opentelekomcloud_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

State File

{ "version": 3, "terraform_version": "0.10.8", "serial": 27, "lineage": "716d7c9a-79c0-43cc-a2fa-e200c4b9b93d", "modules": [ { "path": [ "root" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "Tester" ], "outputs": { "test1_dns_output": { "sensitive": false, "type": "string", "value": "issuetest1.test.test.net." } }, "resources": { "opentelekomcloud_blockstorage_volume_v2.test1OSvolume": { "type": "opentelekomcloud_blockstorage_volume_v2", "depends_on": [], "primary": { "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "attributes": { "attachment.#": "0", "availability_zone": "eu-de-02", "description": "", "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "image_id": "732b56f0-57d9-4b5b-8c9a-5bd8c8b76901", "metadata.%": "0", "name": "Issuetest1.test-OSdisk01", "region": "", "size": "30", "snapshot_id": "", "source_vol_id": "", "volume_type": "SATA" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_compute_instance_v2.test1": { "type": "opentelekomcloud_compute_instance_v2", "depends_on": [ "opentelekomcloud_blockstorage_volume_v2.test1OSvolume." ], "primary": { "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "attributes": { "access_ip_v4": "10.62.81.153", "access_ip_v6": "", "all_metadata.%": "0", "availability_zone": "eu-de-02", "block_device.#": "1", "block_device.0.boot_index": "0", "block_device.0.delete_on_termination": "true", "block_device.0.destination_type": "volume", "block_device.0.guest_format": "", "block_device.0.source_type": "volume", "block_device.0.uuid": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "block_device.0.volume_size": "0", "flavor_id": "computev2-6", "flavor_name": "c2.8xlarge", "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "image_id": "Attempt to boot from volume - no image supplied", "key_pair": "KeyPair-7278", "name": "Issuetest1.test.test.net", "network.#": "1", "network.0.access_network": "false", "network.0.fixed_ip_v4": "10.62.81.153", "network.0.fixed_ip_v6": "", "network.0.floating_ip": "", "network.0.mac": "fa:16:3e:e8:18:8c", "network.0.name": "768910a5-5478-4e11-a01f-cc00eac060e3", "network.0.port": "", "network.0.uuid": "c33fcf0b-6128-43c2-bd47-9d41752db0d3", "region": "", "security_groups.#": "1", "security_groups.3814588639": "default", "stop_before_destroy": "false", "tags.#": "0" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 1800000000000, "delete": 1800000000000, "update": 1800000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_dns_recordset_v2.test1_dns": { "type": "opentelekomcloud_dns_recordset_v2", "depends_on": [ "opentelekomcloud_compute_instance_v2.test1." ], "primary": { "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "attributes": { "description": "", "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "name": "issuetest1.test.test.net.", "records.#": "1", "records.0": "10.62.81.153", "region": "", "ttl": "300", "type": "A", "zone_id": "ff8080825d7c8ef1015e08e52f652399" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000, "update": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" } }, "depends_on": [] }, { "path": [ "root", "Training" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "accessControlLists" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az01" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az02" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "grid-server" ], "outputs": {}, "resources": {}, "depends_on": [] } ] }

Venlig hilsen

Thomas Richard Mann

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358312141, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYPlg7qcO62PXYiiXgaGqgexEal61ks5tLfyJgaJpZM4ReC76.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358513044, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgRPmQsSfvqpg6KZiaboROPuk7hQT4RXks5tLqXagaJpZM4ReC76.

huangtianhua commented 6 years ago

Np☺ So could we close the issue?

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月18日 16:27 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Morning, Thanks for your email, as you say the command terraform output -module="Tester" correctly prints out the output. I’ll raise with the terraform project as ‘terraform output’ should print all outputs where as the modules flag should be a filter on that output. Thanks for your help with this

Venlig hilsen

Thomas Richard Mann

Nordea | Kronos Besøg mig: Grønjordsvej 10, 2300 København S Skriv til mig: Grønjordsvej 10, PO Box 850, 0900 København C Tlf: 55479990 | Mob: 23266418 E-mail: tom.mann@nordea.commailto:tom.mann@nordea.com<mailto:tom.mann@nordea.com%3cmailto:tom.mann@nordea.com> Web: nordea.dkhttp://www.nordea.dk/

Nordea Danmark, filial af Nordea Bank AB (publ), Sverige, org.nr. 516406-0120, Bolagsverket, CVR-nr. 25992180, København

Denne e-mail kan indeholde fortrolige oplysninger. Hvis du fejlagtigt har modtaget denne e-mail, beder vi dig underrette afsenderen, slette e-mailen og undlade at dele eller kopiere den.

From: huangtianhua [mailto:notifications@github.com] Sent: Thursday, January 18, 2018 3:01 AM To: gator1/terraform-provider-opentelekomcloud terraform-provider-opentelekomcloud@noreply.github.com<mailto:terraform-provider-opentelekomcloud@noreply.github.com> Cc: Mann, Tom Tom.Mann@nordea.com<mailto:Tom.Mann@nordea.com>; Comment comment@noreply.github.com<mailto:comment@noreply.github.com> Subject: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Sorry I am not familiar with Module usage, so I read the docs again, and about the terraform output: https://www.terraform.io/docs/commands/output.html

Command: output The terraform output command is used to extract the value of an output variable from the state file. »https://www.terraform.io/docs/commands/output.html#usageUsage Usage: terraform output [options] [NAME] With no additional arguments, output will display all the outputs for the root module. If an output NAME is specified, only the value of that output is printed. The command-line flags are all optional. The list of available flags are:

So I guess you could get the output ‘test1_dns_output’ by cmd ‘terraform output –module=Tester’, try please, thank you.

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月17日 21:59 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Afternoon, Thanks for getting back to me, I downloaded from git on the 15th of Jan so 2 days ago. I can download and rebuild if you have added fixes since then. Code is below again (not allowed to provide the vars file) as is state

environment file

variable "OS_PASSWORD" { description = "The password to login with" }

variable "OS_USERNAME" { description = "The Username to login with" }

variable "OS_DOMAIN" { description = "The Domain Name to use" }

provider "opentelekomcloud" { user_name = "${var.OS_USERNAME}" password = "${var.OS_PASSWORD}" tenant_name = "eu-de" domain_name = "${var.OS_DOMAIN}" auth_url = "https://iam.eu-de.otc.t-systems.com:443/v3" }

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

module.

creates the DNS record

resource "opentelekomcloud_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${opentelekomcloud_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

State File

{ "version": 3, "terraform_version": "0.10.8", "serial": 27, "lineage": "716d7c9a-79c0-43cc-a2fa-e200c4b9b93d", "modules": [ { "path": [ "root" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "Tester" ], "outputs": { "test1_dns_output": { "sensitive": false, "type": "string", "value": "issuetest1.test.test.net." } }, "resources": { "opentelekomcloud_blockstorage_volume_v2.test1OSvolume": { "type": "opentelekomcloud_blockstorage_volume_v2", "depends_on": [], "primary": { "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "attributes": { "attachment.#": "0", "availability_zone": "eu-de-02", "description": "", "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "image_id": "732b56f0-57d9-4b5b-8c9a-5bd8c8b76901", "metadata.%": "0", "name": "Issuetest1.test-OSdisk01", "region": "", "size": "30", "snapshot_id": "", "source_vol_id": "", "volume_type": "SATA" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_compute_instance_v2.test1": { "type": "opentelekomcloud_compute_instance_v2", "depends_on": [ "opentelekomcloud_blockstorage_volume_v2.test1OSvolume." ], "primary": { "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "attributes": { "access_ip_v4": "10.62.81.153", "access_ip_v6": "", "all_metadata.%": "0", "availability_zone": "eu-de-02", "block_device.#": "1", "block_device.0.boot_index": "0", "block_device.0.delete_on_termination": "true", "block_device.0.destination_type": "volume", "block_device.0.guest_format": "", "block_device.0.source_type": "volume", "block_device.0.uuid": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "block_device.0.volume_size": "0", "flavor_id": "computev2-6", "flavor_name": "c2.8xlarge", "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "image_id": "Attempt to boot from volume - no image supplied", "key_pair": "KeyPair-7278", "name": "Issuetest1.test.test.net", "network.#": "1", "network.0.access_network": "false", "network.0.fixed_ip_v4": "10.62.81.153", "network.0.fixed_ip_v6": "", "network.0.floating_ip": "", "network.0.mac": "fa:16:3e:e8:18:8c", "network.0.name": "768910a5-5478-4e11-a01f-cc00eac060e3", "network.0.port": "", "network.0.uuid": "c33fcf0b-6128-43c2-bd47-9d41752db0d3", "region": "", "security_groups.#": "1", "security_groups.3814588639": "default", "stop_before_destroy": "false", "tags.#": "0" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 1800000000000, "delete": 1800000000000, "update": 1800000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_dns_recordset_v2.test1_dns": { "type": "opentelekomcloud_dns_recordset_v2", "depends_on": [ "opentelekomcloud_compute_instance_v2.test1." ], "primary": { "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "attributes": { "description": "", "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "name": "issuetest1.test.test.net.", "records.#": "1", "records.0": "10.62.81.153", "region": "", "ttl": "300", "type": "A", "zone_id": "ff8080825d7c8ef1015e08e52f652399" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000, "update": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" } }, "depends_on": [] }, { "path": [ "root", "Training" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "accessControlLists" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az01" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az02" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "grid-server" ], "outputs": {}, "resources": {}, "depends_on": [] } ] }

Venlig hilsen

Thomas Richard Mann

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358312141, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYPlg7qcO62PXYiiXgaGqgexEal61ks5tLfyJgaJpZM4ReC76.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358513044, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgRPmQsSfvqpg6KZiaboROPuk7hQT4RXks5tLqXagaJpZM4ReC76.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358573049, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYPA-RlSH4gACYv1GV4RJtixnqEKHks5tLwBWgaJpZM4ReC76.

Tom-Mann commented 6 years ago

☺ Sure, I may come back if this is handled in the provider side rather than the base terraform however. But as of now I think this is a terraform issue.

Venlig hilsen

Thomas Richard Mann

Nordea | Kronos Besøg mig: Grønjordsvej 10, 2300 København S Skriv til mig: Grønjordsvej 10, PO Box 850, 0900 København C Tlf: 55479990 | Mob: 23266418 E-mail: tom.mann@nordea.commailto:tom.mann@nordea.com Web: nordea.dkhttp://www.nordea.dk/

Nordea Danmark, filial af Nordea Bank AB (publ), Sverige, org.nr. 516406-0120, Bolagsverket, CVR-nr. 25992180, København

Denne e-mail kan indeholde fortrolige oplysninger. Hvis du fejlagtigt har modtaget denne e-mail, beder vi dig underrette afsenderen, slette e-mailen og undlade at dele eller kopiere den.

From: huangtianhua [mailto:notifications@github.com] Sent: Thursday, January 18, 2018 9:40 AM To: gator1/terraform-provider-opentelekomcloud terraform-provider-opentelekomcloud@noreply.github.com Cc: Mann, Tom Tom.Mann@nordea.com; Comment comment@noreply.github.com Subject: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Np☺ So could we close the issue?

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月18日 16:27 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Morning, Thanks for your email, as you say the command terraform output -module="Tester" correctly prints out the output. I’ll raise with the terraform project as ‘terraform output’ should print all outputs where as the modules flag should be a filter on that output. Thanks for your help with this

Venlig hilsen

Thomas Richard Mann

Nordea | Kronos Besøg mig: Grønjordsvej 10, 2300 København S Skriv til mig: Grønjordsvej 10, PO Box 850, 0900 København C Tlf: 55479990 | Mob: 23266418 E-mail: tom.mann@nordea.commailto:tom.mann@nordea.com<mailto:tom.mann@nordea.com%3cmailto:tom.mann@nordea.com<mailto:tom.mann@nordea.com%3cmailto:tom.mann@nordea.com%3cmailto:tom.mann@nordea.com%3cmailto:tom.mann@nordea.com>> Web: nordea.dkhttp://www.nordea.dk/

Nordea Danmark, filial af Nordea Bank AB (publ), Sverige, org.nr. 516406-0120, Bolagsverket, CVR-nr. 25992180, København

Denne e-mail kan indeholde fortrolige oplysninger. Hvis du fejlagtigt har modtaget denne e-mail, beder vi dig underrette afsenderen, slette e-mailen og undlade at dele eller kopiere den.

From: huangtianhua [mailto:notifications@github.com] Sent: Thursday, January 18, 2018 3:01 AM To: gator1/terraform-provider-opentelekomcloud terraform-provider-opentelekomcloud@noreply.github.com<mailto:terraform-provider-opentelekomcloud@noreply.github.com<mailto:terraform-provider-opentelekomcloud@noreply.github.com%3cmailto:terraform-provider-opentelekomcloud@noreply.github.com>> Cc: Mann, Tom Tom.Mann@nordea.com<mailto:Tom.Mann@nordea.com<mailto:Tom.Mann@nordea.com%3cmailto:Tom.Mann@nordea.com>>; Comment comment@noreply.github.com<mailto:comment@noreply.github.com<mailto:comment@noreply.github.com%3cmailto:comment@noreply.github.com>> Subject: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Sorry I am not familiar with Module usage, so I read the docs again, and about the terraform output: https://www.terraform.io/docs/commands/output.html

Command: output The terraform output command is used to extract the value of an output variable from the state file. »https://www.terraform.io/docs/commands/output.html#usageUsage Usage: terraform output [options] [NAME] With no additional arguments, output will display all the outputs for the root module. If an output NAME is specified, only the value of that output is printed. The command-line flags are all optional. The list of available flags are:

So I guess you could get the output ‘test1_dns_output’ by cmd ‘terraform output –module=Tester’, try please, thank you.

发件人: Tom-Mann [mailto:notifications@github.com] 发送时间: 2018年1月17日 21:59 收件人: gator1/terraform-provider-opentelekomcloud 抄送: Huangtianhua; Author 主题: Re: [gator1/terraform-provider-opentelekomcloud] Change 'records' attribute of dns recordset resource to Set type (#18)

Afternoon, Thanks for getting back to me, I downloaded from git on the 15th of Jan so 2 days ago. I can download and rebuild if you have added fixes since then. Code is below again (not allowed to provide the vars file) as is state

environment file

variable "OS_PASSWORD" { description = "The password to login with" }

variable "OS_USERNAME" { description = "The Username to login with" }

variable "OS_DOMAIN" { description = "The Domain Name to use" }

provider "opentelekomcloud" { user_name = "${var.OS_USERNAME}" password = "${var.OS_PASSWORD}" tenant_name = "eu-de" domain_name = "${var.OS_DOMAIN}" auth_url = "https://iam.eu-de.otc.t-systems.com:443/v3" }

module "Tester" { source = "../../../Modules/TSystems/Tester" Environment = "prod" name_prefix = "Issue" }

module.

creates the DNS record

resource "opentelekomcloud_dns_recordset_v2" "test1_dns" { count = "1" zone_id = "${var.zone_id}" name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" type = "A" records = ["${element(opentelekomcloud_compute_instance_v2.test1.*.access_ip_v4, count.index)}"] }

Creates the machine

resource "opentelekomcloud_compute_instance_v2" "test1" { name = "${var.name_prefix}test1.${var.Environment}.${var.domainName}" flavor_name = "${var.Compute_type}" key_pair = "${var.KeyPair}" availability_zone = "${var.Availability_zone}" security_groups = ["${var.Security_groups}"]

sets the network subnet to use

network { uuid = "${lookup(var.existing_subnet_id,var.Environment )}" }

attach the os disk

block_device { uuid = "${element(opentelekomcloud_blockstorage_volume_v2.test1OSvolume.*.id, count.index)}" source_type = "volume" destination_type = "volume" boot_index = 0 delete_on_termination = true } }

output "test1_dns_output" { value = "${opentelekomcloud_dns_recordset_v2.test1_dns.name}" }

Create the volume

resource "opentelekomcloud_blockstorage_volume_v2" "test1OSvolume" { name = "${var.name_prefix}test1.${var.Environment}-OSdisk${format("%02d", count.index+1)}" size = "30" availability_zone = "${var.Availability_zone}" image_id = "${var.image_id}"

}

State File

{ "version": 3, "terraform_version": "0.10.8", "serial": 27, "lineage": "716d7c9a-79c0-43cc-a2fa-e200c4b9b93d", "modules": [ { "path": [ "root" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "Tester" ], "outputs": { "test1_dns_output": { "sensitive": false, "type": "string", "value": "issuetest1.test.test.net." } }, "resources": { "opentelekomcloud_blockstorage_volume_v2.test1OSvolume": { "type": "opentelekomcloud_blockstorage_volume_v2", "depends_on": [], "primary": { "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "attributes": { "attachment.#": "0", "availability_zone": "eu-de-02", "description": "", "id": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "image_id": "732b56f0-57d9-4b5b-8c9a-5bd8c8b76901", "metadata.%": "0", "name": "Issuetest1.test-OSdisk01", "region": "", "size": "30", "snapshot_id": "", "source_vol_id": "", "volume_type": "SATA" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_compute_instance_v2.test1": { "type": "opentelekomcloud_compute_instance_v2", "depends_on": [ "opentelekomcloud_blockstorage_volume_v2.test1OSvolume." ], "primary": { "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "attributes": { "access_ip_v4": "10.62.81.153", "access_ip_v6": "", "all_metadata.%": "0", "availability_zone": "eu-de-02", "block_device.#": "1", "block_device.0.boot_index": "0", "block_device.0.delete_on_termination": "true", "block_device.0.destination_type": "volume", "block_device.0.guest_format": "", "block_device.0.source_type": "volume", "block_device.0.uuid": "2b4c6feb-a193-4d29-a84b-52ad549541c3", "block_device.0.volume_size": "0", "flavor_id": "computev2-6", "flavor_name": "c2.8xlarge", "id": "5c1a677c-3c86-42e0-bdcb-7fc0fa8b4606", "image_id": "Attempt to boot from volume - no image supplied", "key_pair": "KeyPair-7278", "name": "Issuetest1.test.test.net", "network.#": "1", "network.0.access_network": "false", "network.0.fixed_ip_v4": "10.62.81.153", "network.0.fixed_ip_v6": "", "network.0.floating_ip": "", "network.0.mac": "fa:16:3e:e8:18:8c", "network.0.name": "768910a5-5478-4e11-a01f-cc00eac060e3", "network.0.port": "", "network.0.uuid": "c33fcf0b-6128-43c2-bd47-9d41752db0d3", "region": "", "security_groups.#": "1", "security_groups.3814588639": "default", "stop_before_destroy": "false", "tags.#": "0" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 1800000000000, "delete": 1800000000000, "update": 1800000000000 } }, "tainted": false }, "deposed": [], "provider": "" }, "opentelekomcloud_dns_recordset_v2.test1_dns": { "type": "opentelekomcloud_dns_recordset_v2", "depends_on": [ "opentelekomcloud_compute_instance_v2.test1." ], "primary": { "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "attributes": { "description": "", "id": "ff8080825d7c8ef1015e08e52f652399/ff80808260e9a49a016104451bb70851", "name": "issuetest1.test.test.net.", "records.#": "1", "records.0": "10.62.81.153", "region": "", "ttl": "300", "type": "A", "zone_id": "ff8080825d7c8ef1015e08e52f652399" }, "meta": { "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { "create": 600000000000, "delete": 600000000000, "update": 600000000000 } }, "tainted": false }, "deposed": [], "provider": "" } }, "depends_on": [] }, { "path": [ "root", "Training" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "accessControlLists" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az01" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "engines_az02" ], "outputs": {}, "resources": {}, "depends_on": [] }, { "path": [ "root", "grid-server" ], "outputs": {}, "resources": {}, "depends_on": [] } ] }

Venlig hilsen

Thomas Richard Mann

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358312141, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYPlg7qcO62PXYiiXgaGqgexEal61ks5tLfyJgaJpZM4ReC76.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358513044, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgRPmQsSfvqpg6KZiaboROPuk7hQT4RXks5tLqXagaJpZM4ReC76.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358573049, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE4XYPA-RlSH4gACYv1GV4RJtixnqEKHks5tLwBWgaJpZM4ReC76.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gator1/terraform-provider-opentelekomcloud/pull/18#issuecomment-358576088, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgRPmdW9HTJJU_73yqmjQtCvFo3VDlzfks5tLwNvgaJpZM4ReC76.