You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/infrastructure/accounts/aws/index.md
+47-40Lines changed: 47 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,64 +48,67 @@ When setting up the identity provider you need to use the host domain name of yo
48
48
#### Configuring AWS OIDC Account
49
49
50
50
1. Navigate to **Deploy ➜ Manage ➜ Accounts**, click the **ADD ACCOUNT** and select **AWS Account**.
51
-
2. Add a memorable name for the account.
52
-
3. Provide a description for the account.
53
-
4. Set the **Role ARN** to the ARN from the identity provider associated role. Note that this is different to the ARN of your Identity Provider.
54
-
5. Set the **Session Duration** to the Maximum session duration from the role, in seconds.
55
-
6. Click **SAVE** to save the account.
56
-
7. Before you can test the account you need to add a condition to the identity provider in AWS under **IAM ➜ Roles ➜ {Your AWS Role} ➜ Trust Relationship** :
57
-
```json
58
-
{
59
-
"Version": "2012-10-17",
60
-
"Statement": [
51
+
1. Add a memorable name for the account.
52
+
1. Provide a description for the account.
53
+
1. Set the **Role ARN** to the ARN from the identity provider associated role. Note that this is different to the ARN of your Identity Provider.
54
+
1. Set the **Session Duration** to the Maximum session duration from the role, in seconds.
55
+
1. Click **SAVE** to save the account.
56
+
1. Before you can test the account you need to add a condition to the identity provider in AWS under **IAM ➜ Roles ➜ {Your AWS Role} ➜ Trust Relationship** :
8. Go back to the AWS account in Octopus and click **SAVE AND TEST** to verify the credentials are valid.
77
+
```
78
+
79
+
1. Go back to the AWS account in Octopus and click **SAVE AND TEST** to verify the credentials are valid.
78
80
79
81
Please read [OpenID Connect Subject Identifier](/docs/infrastructure/accounts/openid-connect#subject-keys) on how to customize the **Subject** value.
80
82
81
-
By default, the role trust policy does not have any conditions on the subject identifier. To lock the role down to particular usages you need to modify the [trust policy conditions](https://oc.to/aws-iam-policy-conditions) and add a condition for the `sub`.
83
+
By default, the role trust policy does not have any conditions on the subject identifier. To lock the role down to particular usages you need to modify the [trust policy conditions](https://oc.to/aws-iam-policy-conditions) and add a condition for the `sub`.
82
84
83
85
For example, to lock an identity role to a specific Octopus environment, you can update the conditions:
`default` and `aws-oidc-testing` are the slugs of their respective Octopus resources.
110
+
111
+
`default` and `aws-oidc-testing` are the slugs of their respective Octopus resources.
109
112
110
113
:::div{.hint}
111
114
AWS steps can also defer to the IAM role assigned to the instance that hosts the Octopus Server for authentication. In this scenario there is no need to create the AWS account.
@@ -117,9 +120,10 @@ AWS Accounts can be configured to pass [session tags](https://docs.aws.amazon.co
117
120
118
121
To pass session tags, use the `Custom Claims` field on the AWS OIDC Account.
119
122
120
-
The Claim should be `https://aws.amazon.com/tags`, and the Value should be a JSON object with a `principal_tags` property as documented in the [AWS docs](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_adding-assume-role-idp).
123
+
The Claim should be `https://aws.amazon.com/tags`, and the Value should be a JSON object with a `principal_tags` property as documented in the [AWS docs](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_adding-assume-role-idp).
121
124
122
125
The example below demonstrates supplying a session tag with a key of `octopus-project` and a value of the project name.
126
+
123
127
```json
124
128
125
129
{
@@ -159,9 +163,9 @@ You will need to [allow the sts:TagSession action](https://docs.aws.amazon.com/I
159
163
160
164
```
161
165
162
-
These session tags can then be used to control access to AWS resources by [tagging the AWS resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html#access_tags_control-resources).
166
+
These session tags can then be used to control access to AWS resources by [tagging the AWS resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html#access_tags_control-resources).
163
167
164
-
For example, the policy below allows starting and stopping EC2 instances which are tagged with a key of `octopus-project` and a value matching the project supplied in the session tags supplied as shown above.
168
+
For example, the policy below allows starting and stopping EC2 instances which are tagged with a key of `octopus-project` and a value matching the project supplied in the session tags supplied as shown above.
165
169
166
170
```json
167
171
{
@@ -186,6 +190,7 @@ For example, the policy below allows starting and stopping EC2 instances which a
186
190
]
187
191
}
188
192
```
193
+
189
194

190
195
191
196
## AWS account variables
@@ -214,7 +219,7 @@ The first login process attempts to inherit the role from a web identity token.
214
219
When the `Execute using the AWS service role for an EC2 instance` option is enabled, a worker will first attempt to inherit a pod web identity.
215
220
:::
216
221
217
-
The second login process queries the [Instance Metadata Service](https://oc.to/InstanceMetadataAndUserData) (IMDS), made available to EC2 instances. IMDS is exposed as an HTTP API accessed via http://169.254.169.254. The keys required to assume a service role associated with an EC2 instance are generated by calling the IMDS HTTP API.
222
+
The second login process queries the [Instance Metadata Service](https://oc.to/InstanceMetadataAndUserData) (IMDS), made available to EC2 instances. IMDS is exposed as an HTTP API accessed via `http://169.254.169.254`. The keys required to assume a service role associated with an EC2 instance are generated by calling the IMDS HTTP API.
218
223
219
224
IMDS has two versions, v1, and v2. [IMDSv2 is available to all EC2 instances](https://oc.to/UseIMDSv2) and is optionally required over IMDSv1. Octopus uses IMDSv2 to inherit IAM roles. The worker assumes that IAM role if the request to generate account tokens from the IMDSv2 HTTP API succeeds.
220
225
@@ -233,20 +238,22 @@ First, add the AWS Account as a variable. In the screenshot below, the account h
233
238
The **OctopusPrintVariables** has been set to true to print the variables to the output logs. This is a handy way to view the available variables that can be consumed by a custom script. You can find more information on debugging variables at [Debug problems with Octopus variables](/docs/support/debug-problems-with-octopus-variables).

237
242
:::
238
243
239
244
When running a step, the available variables will be printed to the log. In this example, the following variables are shown:
@@ -257,7 +264,7 @@ When running a step, the available variables will be printed to the log. In this
257
264
258
265
You can then use these variables in your scripts or other step types. For example, the following PowerShell script would print the access key to the console.
0 commit comments