Skip to content

Commit 9e5ba5d

Browse files
Add extra context to docs, for using name vs ARN in adopted resources (#1951)
- Update docs to give example for when to use `adoptedresource.spec.aws.nameOrId` vs `adoptedresource.spec.aws.arn` - Add headers for each section of the spec, so they appear in the sidebar and are linkable By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5cbccea commit 9e5ba5d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

docs/content/docs/user-docs/adopted-resource.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,21 @@ The full spec for the `AdoptedResource` CRD is located [in the API
3939
reference][api-ref]. The spec contains two parts: the AWS resource reference and
4040
the Kubernetes target.
4141

42+
### AWS Resource
43+
4244
The AWS resource reference requires the unique identifier for the object, either
4345
as an ARN or as the name or ID of the object. Which of these is required depends
44-
on the service and the particular resource. You can find which field is required
45-
by finding the unique identifier field used by the `Describe*` or `List*` API
46+
on the service and the particular resource.
47+
You can find which field is required
48+
by finding the unique identifier field used by the `Describe*`, `List*`, or `Get*` API
4649
calls for that resource.
4750

51+
If we were adopting for an IAM Role, since the [IAM Get Role API][iamrole-get] call requires `RoleName`, you should set `.spec.aws.nameOrId` to the name of the role you would like to adopt.
52+
53+
If we were adopting for an IAM Policy, since the [IAM Get Policy API][iampolicy-get] call requires `PolicyArn`, you should set `.spec.aws.arn` to the ARN of the policy you would like to adopt.
54+
55+
### Kubernetes Target
56+
4857
The Kubernetes target requires the `group` and `kind` - these identify from
4958
which service and resource you wish to adopt. For example, to adopt an S3
5059
bucket, you would specify a `group` of `s3.services.k8s.aws` and a `kind` of
@@ -113,6 +122,7 @@ spec:
113122
kind: Integration
114123
```
115124

116-
[apigw-integration]:
117-
https://aws-controllers-k8s.github.io/community/reference/apigatewayv2/v1alpha1/integration/#spec
118-
[integ-describe]: https://docs.aws.amazon.com/sdk-for-go/api/service/apigatewayv2/#GetIntegrationInput
125+
[apigw-integration]: https://aws-controllers-k8s.github.io/community/reference/apigatewayv2/v1alpha1/integration/#spec
126+
[integ-describe]: https://docs.aws.amazon.com/sdk-for-go/api/service/apigatewayv2/#GetIntegrationInput
127+
[iamrole-get]: https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetRole.html
128+
[iampolicy-get]: https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetPolicy.html

0 commit comments

Comments
 (0)