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

Improve external-name config of iot thing type #1456

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/externalname.go
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,8 @@ var TerraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{
// TODO: For now API is not normalized. While testing resource we can check the actual ID and normalize the API.
"aws_iot_thing_principal_attachment": config.IdentifierFromProvider,
// IOT Thing Types can be imported using the name
"aws_iot_thing_type": config.IdentifierFromProvider,
// NameAsIdentifier would be better, but that would be a breaking api change to remove spec.forProvider.name
"aws_iot_thing_type": FormattedIdentifierFromProvider("", "name"),
// IoT Topic Rules can be imported using the name
"aws_iot_topic_rule": config.NameAsIdentifier,
// IoT topic rule destinations can be imported using the arn
Expand Down
5 changes: 3 additions & 2 deletions examples/iot/v1beta1/thingtype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ kind: ThingType
metadata:
annotations:
meta.upbound.io/example-id: iot/v1beta1/thingtype
uptest.upbound.io/update-parameter: '{"deprecated":true}'
labels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: lightbulb
name: lightbulb
spec:
forProvider:
name: "my_iot_thing"
region: us-west-1
region: us-east-2
9 changes: 5 additions & 4 deletions examples/iot/v1beta2/thingtype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ kind: ThingType
metadata:
annotations:
meta.upbound.io/example-id: iot/v1beta2/thingtype
uptest.upbound.io/update-parameter: '{"deprecated":true}'
labels:
testing.upbound.io/example-name: example
name: lightbulb
testing.upbound.io/example-name: toaster
name: toaster
spec:
forProvider:
name: my_iot_thing
region: us-west-1
name: bread_heater
region: us-east-2
Loading