-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Support VPC sharing #6642
Support VPC sharing #6642
Changes from 8 commits
b523e18
f5ded05
cfacf61
0692bf7
53fe54c
eac7129
97d1f64
840a8b6
b8a2a4a
71e1147
92eb437
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -38,6 +38,7 @@ func TestAccAWSDefaultNetworkAcl_basic(t *testing.T) { | |||||
Check: resource.ComposeTestCheckFunc( | ||||||
testAccGetAWSDefaultNetworkAcl("aws_default_network_acl.default", &networkAcl), | ||||||
testAccCheckAWSDefaultACLAttributes(&networkAcl, []*ec2.NetworkAclEntry{}, 0, 2), | ||||||
resource.TestCheckResourceAttrSet("aws_default_network_acl.default", "owner_id"), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of allowing any value here (e.g.
Suggested change
The same applies to other similar new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, will do. Good to know. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar changes to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
), | ||||||
}, | ||||||
}, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,6 +28,10 @@ func resourceAwsInternetGateway() *schema.Resource { | |||||
Optional: true, | ||||||
}, | ||||||
"tags": tagsSchema(), | ||||||
"owner_id": { | ||||||
Type: schema.TypeString, | ||||||
Computed: true, | ||||||
}, | ||||||
}, | ||||||
} | ||||||
} | ||||||
|
@@ -70,7 +74,12 @@ func resourceAwsInternetGatewayCreate(d *schema.ResourceData, meta interface{}) | |||||
} | ||||||
|
||||||
// Attach the new gateway to the correct vpc | ||||||
return resourceAwsInternetGatewayAttach(d, meta) | ||||||
err = resourceAwsInternetGatewayAttach(d, meta) | ||||||
if err != nil { | ||||||
return err | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to return some context about when this error occurs since the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, will do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
} | ||||||
|
||||||
return resourceAwsInternetGatewayRead(d, meta) | ||||||
} | ||||||
|
||||||
func resourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) error { | ||||||
|
@@ -95,6 +104,7 @@ func resourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) er | |||||
} | ||||||
|
||||||
d.Set("tags", tagsToMap(ig.Tags)) | ||||||
d.Set("owner_id", ig.OwnerId) | ||||||
|
||||||
return nil | ||||||
} | ||||||
|
@@ -120,7 +130,7 @@ func resourceAwsInternetGatewayUpdate(d *schema.ResourceData, meta interface{}) | |||||
|
||||||
d.SetPartial("tags") | ||||||
|
||||||
return nil | ||||||
return resourceAwsInternetGatewayRead(d, meta) | ||||||
} | ||||||
|
||||||
func resourceAwsInternetGatewayDelete(d *schema.ResourceData, meta interface{}) error { | ||||||
|
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.
Not necessarily for this PR, but we can use
resource.TestCheckResourceAttrPair()
instead of this custom logic. I'm not opposed to starting with just these new attributes to start that technical debt cleanup.Same applies below to other similar logic. 👍
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.
Yeah, I added that function back in Feb 2017 😄. OK, I'll use it here.
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.
Similar changes to
data_source_aws_route_table_test.go
data_source_aws_subnet_test.go
data_source_aws_vpc_test.go
.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.
Done.