RDS: Add support for InstanceState - #1794
Conversation
|
/test-examples="examples/rds/v1beta1/instancestate.yaml" |
2 similar comments
|
/test-examples="examples/rds/v1beta1/instancestate.yaml" |
|
/test-examples="examples/rds/v1beta1/instancestate.yaml" |
| // rds | ||
| // | ||
| // aws_rds_instance_state import format: rds_instance_state-instanceId-12345678 | ||
| "aws_rds_instance_state": config.TemplatedStringAsIdentifier("", "rds_instance_state-{{ .parameters.identifier }}"), |
There was a problem hiding this comment.
The import section in the Terraform document seemed a bit contradictory to me. The document gives two different formats for importing this resource.
db-L72FUFBZX2RRXT3HOJSIUQVOKErds_instance_state-instanceId-12345678
The second format and the one we are using here seems a bit suspicious to me. We cannot observe the import test because the uptest is currently failing due to a connection error. Did you perform a manual import test?
There was a problem hiding this comment.
And from what I understand from the source code, the correct format seems to be the first one(db-...), can you please try the following configuration. And it would be great to verify this with an import test :)
| "aws_rds_instance_state": config.TemplatedStringAsIdentifier("", "rds_instance_state-{{ .parameters.identifier }}"), | |
| "aws_rds_instance_state": config.TemplatedStringAsIdentifier("", "{{ .parameters.identifier }}"), |
There was a problem hiding this comment.
@turkenf I updated the simplified configuration according to your suggestion.
Observations:
- Everything works in general according to the initial PR description. I still see
example-instancestate'internal' name as external name of instance state for some reason
k get -f examples/rds/v1beta1/instancestate.yaml
NAME SYNCED READY EXTERNAL-NAME AGE
instancestate.rds.aws.upbound.io/example-instancestate True True example-instancestate 15m
NAME READY SYNCED EXTERNAL-NAME AGE
instance.rds.aws.upbound.io/example-instancestate True True db-5XBUBIXX5VXQQTSMYIJTCTYRGQ 15m
- Import test. Import works even when
crossplane.io/external-nameiswhatever. The resolvedforProvider.identifiertakes presedence and drives the import.
k get -f examples/rds/v1beta1/instancestate.yaml
NAME SYNCED READY EXTERNAL-NAME AGE
instancestate.rds.aws.upbound.io/example-instancestate True True whatever 5m7s
NAME READY SYNCED EXTERNAL-NAME AGE
instance.rds.aws.upbound.io/example-instancestate True True db-5XBUBIXX5VXQQTSMYIJTCTYRGQ 26m
So from the functional standpoint everything is working, the default extetnal-name propagation is slightly confusing
966e20a to
1322ea2
Compare
|
/test-examples="examples/rds/v1beta1/instancestate.yaml" |
8d79e51 to
32a768c
Compare
|
/test-examples="examples/rds/v1beta1/instancestate.yaml" |
Signed-off-by: Yury Tsarev <yury@upbound.io>
Signed-off-by: Yury Tsarev <yury@upbound.io>
Signed-off-by: Fatih Türken <turkenf@gmail.com>
Signed-off-by: Fatih Türken <turkenf@gmail.com>
32a768c to
41f50e1
Compare
|
/test-examples="examples/rds/v1beta1/instancestate.yaml" |
Description of your changes
Add support for https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_instance_state
I have:
make generateand committed the results (ideally in a separate commit).make check-diff.How has this code been tested
Change
state: availabletostate: stoppedin InstanceState specReapply manifest, observe that the target RDS instance is getting stopped in the console, first
Stopping...then eventually getting toStopped Temporarily