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 aws_appmesh_virtual_router resource #6720

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

ewbankkit
Copy link
Contributor

Related:

Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAppmesh'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAppmesh -timeout 120m
=== RUN   TestAccAWSAppmesh
=== RUN   TestAccAWSAppmesh/Mesh
=== RUN   TestAccAWSAppmesh/Mesh/basic
=== RUN   TestAccAWSAppmesh/VirtualRouter
=== RUN   TestAccAWSAppmesh/VirtualRouter/basic
--- PASS: TestAccAWSAppmesh (48.29s)
    --- PASS: TestAccAWSAppmesh/Mesh (17.78s)
        --- PASS: TestAccAWSAppmesh/Mesh/basic (17.78s)
    --- PASS: TestAccAWSAppmesh/VirtualRouter (30.51s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/basic (30.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	65.881s

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 4, 2018
@bflad bflad added new-resource Introduces a new resource. service/appmesh Issues and PRs that pertain to the appmesh service. labels Dec 5, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

A few little things then this should be good to go, thanks @ewbankkit 👍


d.SetId(aws.StringValue(resp.VirtualRouter.Metadata.Uid))

return resourceAwsAppmeshVirtualRouterUpdate(d, meta)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be calling the Read function instead? Spec is already handled via Create

Suggested change
return resourceAwsAppmeshVirtualRouterUpdate(d, meta)
return resourceAwsAppmeshVirtualRouterRead(d, meta)

func resourceAwsAppmeshVirtualRouterUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).appmeshconn

if !d.IsNewResource() && d.HasChange("spec") {
Copy link
Contributor

Choose a reason for hiding this comment

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

The d.IsNewResource() check here is extraneous if Read is called after Create

Suggested change
if !d.IsNewResource() && d.HasChange("spec") {
if d.HasChange("spec") {

VirtualRouterName: aws.String(d.Get("name").(string)),
})
if err != nil {
if isAWSErr(err, "NotFoundException", "") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: SDK provided constant available:

Suggested change
if isAWSErr(err, "NotFoundException", "") {
if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") {

VirtualRouterName: aws.String(d.Get("name").(string)),
})
if err != nil {
if isAWSErr(err, "NotFoundException", "") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: SDK provided constant available:

Suggested change
if isAWSErr(err, "NotFoundException", "") {
if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") {

VirtualRouterName: aws.String(rs.Primary.Attributes["name"]),
})
if err != nil {
if isAWSErr(err, "NotFoundException", "") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: SDK provided constant available:

Suggested change
if isAWSErr(err, "NotFoundException", "") {
if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") {

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Dec 5, 2018
@ewbankkit
Copy link
Contributor Author

Updates made after code review.
Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAppmesh'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAppmesh -timeout 120m
=== RUN   TestAccAWSAppmesh
=== RUN   TestAccAWSAppmesh/Mesh
=== RUN   TestAccAWSAppmesh/Mesh/basic
=== RUN   TestAccAWSAppmesh/VirtualRouter
=== RUN   TestAccAWSAppmesh/VirtualRouter/basic
--- PASS: TestAccAWSAppmesh (43.34s)
    --- PASS: TestAccAWSAppmesh/Mesh (16.47s)
        --- PASS: TestAccAWSAppmesh/Mesh/basic (16.47s)
    --- PASS: TestAccAWSAppmesh/VirtualRouter (26.87s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/basic (26.87s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	62.817s

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Dec 5, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Another great addition, thanks, @ewbankkit! 🚀

--- PASS: TestAccAWSAppmesh (31.28s)
    --- PASS: TestAccAWSAppmesh/Mesh (11.73s)
        --- PASS: TestAccAWSAppmesh/Mesh/basic (11.73s)
    --- PASS: TestAccAWSAppmesh/VirtualRouter (19.55s)
        --- PASS: TestAccAWSAppmesh/VirtualRouter/basic (19.55s)

@bflad bflad added this to the v1.51.0 milestone Dec 5, 2018
@bflad bflad merged commit ca03372 into hashicorp:master Dec 5, 2018
bflad added a commit that referenced this pull request Dec 5, 2018
@ewbankkit ewbankkit deleted the add-appmesh-virtual-router branch December 5, 2018 18:40
@bflad
Copy link
Contributor

bflad commented Dec 5, 2018

This has been released in version 1.51.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/appmesh Issues and PRs that pertain to the appmesh service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants