Skip to content

Commit ef73dcf

Browse files
pavolloffaymax-cx
authored andcommitted
OBSDOCS-1254: Document AWS STS
Signed-off-by: Pavol Loffay <[email protected]>
1 parent f7e160f commit ef73dcf

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Module included in the following assemblies:
2+
//
3+
//* observability/distr_tracing/distr_tracing_tempo/distr-tracing-tempo-installing.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="distr-tracing-tempo-object-storage-setup-aws-sts-install_{context}"]
7+
= Setting up the Amazon S3 storage with the Security Token Service
8+
9+
You can set up the Amazon S3 storage with the Security Token Service (STS) by using the AWS Command Line Interface (AWS CLI).
10+
11+
:FeatureName: The Amazon S3 storage with the Security Token Service
12+
include::snippets/technology-preview.adoc[leveloffset=+1]
13+
14+
.Prerequisites
15+
16+
* You have installed the latest version of the AWS CLI.
17+
18+
.Procedure
19+
20+
. Create an AWS S3 bucket.
21+
22+
. Create the following `trust.json` file for the AWS IAM policy that will set up a trust relationship for the AWS IAM role, created in the next step, with the service account of the TempoStack instance:
23+
+
24+
[source,yaml]
25+
----
26+
{
27+
"Version": "2012-10-17",
28+
"Statement": [
29+
{
30+
"Effect": "Allow",
31+
"Principal": {
32+
"Federated": "arn:aws:iam::${<aws_account_id>}:oidc-provider/${<oidc_provider>}" # <1>
33+
},
34+
"Action": "sts:AssumeRoleWithWebIdentity",
35+
"Condition": {
36+
"StringEquals": {
37+
"${OIDC_PROVIDER}:sub": [
38+
"system:serviceaccount:${<openshift_project_for_tempostack>}:tempo-${<tempostack_cr_name>}" # <2>
39+
"system:serviceaccount:${<openshift_project_for_tempostack>}:tempo-${<tempostack_cr_name>}-query-frontend"
40+
]
41+
}
42+
}
43+
}
44+
]
45+
}
46+
----
47+
<1> OIDC provider that you have configured on the {product-title}. You can get the configured OIDC provider value also by running the following command: `$ oc get authentication cluster -o json | jq -r '.spec.serviceAccountIssuer' | sed 's~http[s]*://~~g'`.
48+
<2> Namespace in which you intend to create the TempoStack instance.
49+
50+
. Create an AWS IAM role by attaching the `trust.json` policy file that you created:
51+
+
52+
[source,terminal]
53+
----
54+
$ aws iam create-role \
55+
--role-name "tempo-s3-access" \
56+
--assume-role-policy-document "file:///tmp/trust.json" \
57+
--query Role.Arn \
58+
--output text
59+
----
60+
61+
. Attach an AWS IAM policy to the created role:
62+
+
63+
[source,terminal]
64+
----
65+
$ aws iam attach-role-policy \
66+
--role-name "tempo-s3-access" \
67+
--policy-arn "arn:aws:iam::aws:policy/AmazonS3FullAccess"
68+
----
69+
70+
. In the {product-title}, create an object storage secret with keys as follows:
71+
+
72+
[source,yaml]
73+
----
74+
apiVersion: v1
75+
kind: Secret
76+
metadata:
77+
name: minio-test
78+
stringData:
79+
bucket: <s3_bucket_name>
80+
region: <s3_region>
81+
role_arn: <s3_role_arn>
82+
type: Opaque
83+
----

observability/distr_tracing/distr_tracing_tempo/distr-tracing-tempo-installing.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ include::modules/distr-tracing-tempo-install-tempomonolithic-cli.adoc[leveloffse
6161

6262
include::modules/distr-tracing-tempo-storage-ref.adoc[leveloffset=+1]
6363

64+
include::modules/distr-tracing-tempo-object-storage-setup-aws-sts-install.adoc[leveloffset=+2]
65+
66+
[role="_additional-resources"]
67+
.Additional resources
68+
69+
* link:https://docs.aws.amazon.com/iam/[AWS Identity and Access Management Documentation]
70+
* link:https://docs.aws.amazon.com/cli/[AWS Command Line Interface Documentation]
71+
* xref:../../../authentication/identity_providers/configuring-oidc-identity-provider.adoc#configuring-oidc-identity-provider[Configuring an OpenID Connect identity provider]
72+
* link:https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html[Identify AWS resources with Amazon Resource Names (ARNs)]
73+
6474
[role="_additional-resources"]
6575
[id="additional-resources_dist-tracing-tempo-installing"]
6676
== Additional resources

snippets/distr-tracing-tempo-required-secret-parameters.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ See link:https://operator.min.io/[MinIO Operator].
5151

5252
`access_key_secret: <s3_access_key_secret>`
5353

54+
|Amazon S3 with Security Token Service (STS)
55+
|
56+
`name: tempostack-dev-s3 # example`
57+
58+
`bucket: <s3_bucket_name> # link:https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html[Amazon S3 documentation]`
59+
60+
`region: <s3_region>`
61+
62+
`role_arn: <s3_role_arn>`
63+
5464
|Microsoft Azure Blob Storage
5565
|
5666
`name: tempostack-dev-azure # example`

0 commit comments

Comments
 (0)