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

feature: Add amazon location tracker resource #19649

Closed
wants to merge 5 commits into from
Closed

feature: Add amazon location tracker resource #19649

wants to merge 5 commits into from

Conversation

pocket7878
Copy link
Contributor

@pocket7878 pocket7878 commented Jun 3, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #19629

Output from acceptance testing:

❯ make testacc TEST=TestAccLocationTracker_ PKG=location

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/location/... -v -count 1 -parallel 20   -timeout 180m
=== RUN   TestAccLocationTracker_basic
=== PAUSE TestAccLocationTracker_basic
=== RUN   TestAccLocationTracker_disappers
=== PAUSE TestAccLocationTracker_disappers
=== RUN   TestAccLocationTracker_Description
=== PAUSE TestAccLocationTracker_Description
=== RUN   TestAccLocationTracker_Tags
=== PAUSE TestAccLocationTracker_Tags
=== CONT  TestAccLocationTracker_basic
=== CONT  TestAccLocationTracker_Description
=== CONT  TestAccLocationTracker_Tags
=== CONT  TestAccLocationTracker_disappers
--- PASS: TestAccLocationTracker_disappers (39.80s)
--- PASS: TestAccLocationTracker_basic (43.26s)
--- PASS: TestAccLocationTracker_Description (56.82s)
--- PASS: TestAccLocationTracker_Tags (88.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/location	89.948s

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. labels Jun 3, 2021
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/location Issues and PRs that pertain to the location service. needs-triage Waiting for first response or review from a maintainer. labels Jun 3, 2021
@pocket7878 pocket7878 changed the title [WIP] feature: Add amazon location tracker resource feature: Add amazon location tracker resource Jun 3, 2021
@pocket7878 pocket7878 marked this pull request as ready for review June 3, 2021 16:41
@pocket7878 pocket7878 requested a review from a team as a code owner June 3, 2021 16:41
@pocket7878 pocket7878 marked this pull request as draft June 3, 2021 16:58
@pocket7878 pocket7878 changed the title feature: Add amazon location tracker resource [WIP] feature: Add amazon location tracker resource Jun 3, 2021
@pocket7878 pocket7878 marked this pull request as ready for review June 3, 2021 18:03
@pocket7878 pocket7878 changed the title [WIP] feature: Add amazon location tracker resource feature: Add amazon location tracker resource Jun 3, 2021
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Required: true,
ForceNew: true,
},
"description": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

result.PricingPlan = aws.String(pricingPlan)

pricingPlanDataSource, ok := d.GetOk("pricing_plan_data_source")
if (pricingPlan == "MobileAssetTracking" || pricingPlan == "MobileAssetManagement") && !ok {
Copy link
Collaborator

Choose a reason for hiding this comment

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

use sdk enums

"Here",
}, false),
},
"tags": tagsSchemaForceNew(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure this should be force new, see docs for updating tags in update func.
More specifically follow the below example:

if d.HasChange("tags_all") {
  o, n := d.GetChange("tags_all")
  if err := keyvaluetags.EksUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
    return fmt.Errorf("error updating tags: %s", err)
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently Amazon Location Service does not provider API for modify tracker attributes:
https://docs.aws.amazon.com/location-trackers/latest/APIReference/API_CreateTracker.html

We'll need to add this functionality when the API becomes available.

Copy link
Collaborator

Choose a reason for hiding this comment

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

resources don't usually support updating tags in their Update action. Location does have a tag resource api available:
https://docs.aws.amazon.com/cli/latest/reference/location/tag-resource.html

@pocket7878 pocket7878 requested review from DrFaust92 and removed request for a team June 4, 2021 07:40
@pocket7878
Copy link
Contributor Author

@DrFaust92 Thank you for your review!
Implemented tag update & update documentations.

@breathingdust breathingdust added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 31, 2021
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@github-actions github-actions bot added generators Relates to code generators. tags Pertains to resource tagging. labels Feb 5, 2022
# Conflicts:
#	aws/internal/keyvaluetags/generators/servicetags/main.go
#	aws/internal/keyvaluetags/generators/updatetags/main.go
#	aws/internal/keyvaluetags/service_generation_customizations.go
#	aws/internal/keyvaluetags/service_tags_gen.go
#	aws/internal/keyvaluetags/update_tags_gen.go
#	aws/provider.go
#	internal/service/ec2/resource_aws_location_tracker.go
#	internal/service/ec2/resource_aws_location_tracker_test.go
@pocket7878
Copy link
Contributor Author

Sorry for my late reaction. I'v updated my code to resolve conflicts.

@pocket7878 pocket7878 closed this Jun 25, 2022
@pocket7878 pocket7878 deleted the f-add-amazon-location-tracker-resource branch June 25, 2022 06:45
@ewbankkit
Copy link
Contributor

Superseded by #25466.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
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. generators Relates to code generators. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/location Issues and PRs that pertain to the location service. size/XL Managed by automation to categorize the size of a PR. tags Pertains to resource tagging. 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.

5 participants