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

add enterprise_project_id to secgroup #606

Merged
merged 1 commit into from
Oct 27, 2020

Conversation

Jason-Zhang9309
Copy link
Collaborator

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

@@ -43,6 +44,18 @@ func ResourceNetworkingSecGroupV2() *schema.Resource {
Optional: true,
Computed: true,
},
"vpc_id": {
Copy link
Member

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.

Copy link
Collaborator Author

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),
Copy link
Member

Choose a reason for hiding this comment

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

ditto.

Copy link
Collaborator Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

ditto.

Copy link
Collaborator Author

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" {
Copy link
Member

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

Copy link
Collaborator Author

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))
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@niuzhenguo niuzhenguo merged commit b0d872c into huaweicloud:master Oct 27, 2020
@niuzhenguo
Copy link
Member

Related to #435

@Jason-Zhang9309 Jason-Zhang9309 deleted the dev-eps-sg branch October 29, 2020 02:20
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.

3 participants