-
Notifications
You must be signed in to change notification settings - Fork 50
/
external-secrets-iam.yaml
71 lines (71 loc) · 1.87 KB
/
external-secrets-iam.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
apiVersion: iam.aws.crossplane.io/v1beta1
kind: Role
metadata:
name: external-secrets-role
labels:
type: external-secrets-role
spec:
forProvider:
assumeRolePolicyDocument: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::${ACCOUNT_ID}:oidc-provider/${OIDC_PROVIDER}"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"${OIDC_PROVIDER}:aud": "sts.amazonaws.com",
"${OIDC_PROVIDER}:sub": "system:serviceaccount:sealed-secrets:aws-secrets-manager"
}
}
}
]
}
providerConfigRef:
name: default
---
apiVersion: iam.aws.crossplane.io/v1beta1
kind: Policy
metadata:
name: external-secrets-policy
spec:
forProvider:
name: external-secrets-policy
document: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
],
"Resource": [
"arn:aws:secretsmanager:${AWS_REGION}:${ACCOUNT_ID}:secret:sealed-secrets*"
]
}
]
}
providerConfigRef:
name: default
---
apiVersion: iam.aws.crossplane.io/v1beta1
kind: RolePolicyAttachment
metadata:
name: external-secrets-attachment
spec:
forProvider:
policyArnRef:
name: external-secrets-policy
roleNameRef:
name: external-secrets-role
providerConfigRef:
name: default