-
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
feature: Add amazon location tracker resource #19649
feature: Add amazon location tracker resource #19649
Conversation
aws/resource_aws_location_tracker.go
Outdated
"name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, |
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.
add validation for len and regex as mentioned at https://docs.aws.amazon.com/location-trackers/latest/APIReference/API_CreateTracker.html#API_CreateTracker_RequestSyntax
aws/resource_aws_location_tracker.go
Outdated
Required: true, | ||
ForceNew: true, | ||
}, | ||
"description": { |
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.
same as above
aws/resource_aws_location_tracker.go
Outdated
result.PricingPlan = aws.String(pricingPlan) | ||
|
||
pricingPlanDataSource, ok := d.GetOk("pricing_plan_data_source") | ||
if (pricingPlan == "MobileAssetTracking" || pricingPlan == "MobileAssetManagement") && !ok { |
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.
use sdk enums
aws/resource_aws_location_tracker.go
Outdated
"Here", | ||
}, false), | ||
}, | ||
"tags": tagsSchemaForceNew(), |
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 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)
}
}
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.
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.
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.
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
@DrFaust92 Thank you for your review! |
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 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. |
# 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
Sorry for my late reaction. I'v updated my code to resolve conflicts. |
Superseded by #25466. |
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. |
Community Note
Relates #19629
Output from acceptance testing: