-
Notifications
You must be signed in to change notification settings - Fork 162
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
add enterprise_project_id to secgroup #606
Conversation
@@ -43,6 +44,18 @@ func ResourceNetworkingSecGroupV2() *schema.Resource { | |||
Optional: true, | |||
Computed: true, | |||
}, | |||
"vpc_id": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to just remove this parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
opts := securitygroups.CreateOpts{ | ||
Name: d.Get("name").(string), | ||
EnterpriseProjectId: GetEnterpriseProjectID(d, config), | ||
VpcId: d.Get("vpc_id").(string), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
d.Set("name", security_group.Name) | ||
d.Set("vpc_id", security_group.VpcId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -155,6 +176,16 @@ resource "huaweicloud_networking_secgroup_v2" "secgroup_1" { | |||
} | |||
` | |||
|
|||
func testAccNetworkingV2SecGroup_epsId() string { | |||
return fmt.Sprintf(` | |||
resource "huaweicloud_networking_secgroup_v2" "secgroup_1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to remove the resource version v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -98,28 +116,40 @@ func resourceNetworkingSecGroupV2Create(d *schema.ResourceData, meta interface{} | |||
|
|||
d.SetId(security_group.ID) | |||
|
|||
description := d.Get("description").(string) | |||
networkingClient3, err := config.NetworkingV2Client(GetRegion(d, config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can have more meaningful names rather than networkingClient2 and networkingClient3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
6bb38ab
to
f6bfdc4
Compare
Related to #435 |
make testacc TEST='./huaweicloud' TESTARGS='-run TestAccNetworkingV2SecGroup_withEpsId'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud -v -run TestAccNetworkingV2SecGroup_withEpsId -timeout 360m
=== RUN TestAccNetworkingV2SecGroup_withEpsId
--- PASS: TestAccNetworkingV2SecGroup_withEpsId (18.94s)
PASS
ok github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud 18.992s