Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCPE-909 - Add TGW attachment imports #64

Merged
merged 2 commits into from
Feb 16, 2021
Merged

HCPE-909 - Add TGW attachment imports #64

merged 2 commits into from
Feb 16, 2021

Conversation

roaks3
Copy link
Contributor

@roaks3 roaks3 commented Feb 12, 2021

Adds import functionality, where the import id is {hvn_id}:{transit_gateway_attachment_id}

Most of the functionality matches what is already done with network peering.

One note: because resource_share_arn is not available in our responses, it cannot be populated into Terraform state from an import. This is a known case that can be handled with an ignore_changes block (I've included this in the documentation here), but the preferred solution would be to include this value in the response, if that is an option here.

Copy link
Contributor

@smaant smaant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question, otherwise LGTM

hvnID := idParts[0]
tgwAttID := idParts[1]
loc := &sharedmodels.HashicorpCloudLocationLocation{
ProjectID: client.Config.ProjectID,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't we also need an org-id here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This location is used to create the link format we use for ids (/project/123/hashicorp.network.tgw-attachment/456), so we only actually need the project id. The link format used to include more information, but since it is now only the project id that gets used, I'll make a note to consider simplifying this across our resources 🙏 .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roaks3 roaks3 merged commit a6b128e into main Feb 16, 2021
@roaks3 roaks3 deleted the HCPE-909-tgw-import branch February 16, 2021 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants