Skip to content

Commit 1e18f6c

Browse files
authored
Merge pull request #49586 from pneedle-rh/osdocs-3803-adding-custom-arn-path-content
OSDOCS-3803 - Adding custom ARN path content for ROSA
2 parents db6b750 + 1697a5d commit 1e18f6c

10 files changed

+357
-73
lines changed

modules/rosa-create-objects.adoc

Lines changed: 112 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,52 @@
66
[id="rosa-create-objects_{context}"]
77
= Create objects
88

9-
109
This section describes the `create` commands for clusters and resources.
1110

11+
[id="rosa-create-account-roles_{context}"]
12+
== create account-roles
13+
14+
Create the needed account-wide role and policy resources for your cluster.
15+
16+
.Syntax
17+
[source,terminal]
18+
----
19+
$ rosa create account-roles [flags]
20+
----
21+
22+
.Flags
23+
[cols="30,70"]
24+
|===
25+
|Option |Definition
26+
27+
|--debug
28+
|Enable debug mode.
29+
30+
|-i, --interactive
31+
|Enable interactive mode.
32+
33+
|-m, --mode string
34+
|How to perform the operation. Valid options are:
35+
auto: Resource changes will be automatic applied using the current AWS account
36+
manual: Commands necessary to modify AWS resources will be output to be run manually
37+
38+
|--path string
39+
|The ARN path for the account-wide roles and policies, including the Operator policies.
40+
41+
|--permissions-boundary string
42+
|The ARN of the policy that is used to set the permissions boundary for the account roles.
43+
44+
|--prefix string
45+
|User-defined prefix for all generated AWS resources. The default is `ManagedOpenShift`.
46+
47+
|--profile string
48+
|Use a specific AWS profile from your credential file.
49+
50+
|-y, --yes
51+
|Automatically answer yes to confirm operation.
52+
53+
|===
54+
1255
[id="rosa-create-admin_{context}"]
1356
== create admin
1457

@@ -83,6 +126,9 @@ $ rosa create cluster --cluster=<cluster_name> | <cluster_id> [arguments]
83126
|--compute-nodes
84127
|The number (integer) of worker nodes to provision per zone. Single-zone clusters require at least 2 nodes. Multi-zone clusters require at least 3 nodes. Default: `2` for single-az; `3` for multi-az
85128

129+
|--controlplane-iam-role string
130+
|The Amazon Resource Name (ARN) of the IAM role that will be attached to control plane instances.
131+
86132
|--disable-scp-checks
87133
|Indicates whether cloud permission checks are disabled when attempting to install a cluster.
88134

@@ -119,17 +165,25 @@ $ rosa create cluster --cluster=<cluster_name> | <cluster_id> [arguments]
119165
|--region
120166
|The AWS region (string) where your worker pool will be located. This argument overrides the `AWS_REGION` environment variable.
121167

168+
|--role-arn string
169+
|The Amazon Resource Name (ARN) of the installer role that {cluster-manager} will assume to create the cluster.
170+
122171
|--service-cidr
123172
|Block of IP addresses (ipNet) for services. Example: `172.30.0.0/16`
124173

125174
|--subnet-ids
126175
|The subnet IDs (string) to use when installing the cluster. Subnet IDs must be in pairs with one private subnet ID and one public subnet ID per availability zone. Subnets are comma-delimited. Example: `--subnet-ids=subnet-1,subnet-2`. Leave the value empty for installer-provisioned subnet IDs.
127176

128-
129177
When using `--private-link`, the `--subnet-ids` argument is required and only one private subnet is allowed per zone.
130178

179+
|--support-role-arn string
180+
|The Amazon Resource Name (ARN) of the role used by Red Hat Site Reliabilty Engineers (SREs) to enable access to the cluster account to provide support.
181+
131182
|--version
132183
|The version (string) of OpenShift Container Platform that will be used to install the cluster. Example: `4.3.10`
184+
185+
|--worker-iam-role string
186+
|The Amazon Resource Name (ARN) of the IAM role that will be attached to compute instances.
133187
|===
134188

135189
.Optional arguments inherited from parent commands
@@ -499,7 +553,7 @@ $ rosa create machinepool --cluster=mycluster --replicas=2 --instance-type=r5.2x
499553
[id="rosa-create-ocm-role_{context}"]
500554
== create ocm-role
501555

502-
Create the needed ocm-role resources for your cluster.
556+
Create the required ocm-role resources for your cluster.
503557

504558
.Syntax
505559
[source,terminal]
@@ -522,25 +576,73 @@ $ rosa create ocm-role [flags]
522576
|Enable interactive mode.
523577

524578
|-m, --mode string
525-
|How to perform the operation. Valid options are:
526-
auto: Resource changes will be automatic applied using the current AWS account
527-
manual: Commands necessary to modify AWS resources will be output to be run manually
579+
a|How to perform the operation. Valid options are:
580+
581+
* `auto`: Resource changes will be automatic applied using the current AWS account
582+
* `manual`: Commands necessary to modify AWS resources will be output to be run manually
583+
584+
|--path string
585+
|The ARN path for the OCM role and policies.
528586

529587
|--permissions-boundary string
530588
|The ARN of the policy that is used to set the permissions boundary for the OCM role.
531589

532590
|--prefix string
533-
|User-defined prefix for all generated AWS resources (default "ManagedOpenShift")
591+
|User-defined prefix for all generated AWS resources. The default is `ManagedOpenShift`.
534592

535593
|--profile string
536594
|Use a specific AWS profile from your credential file.
537595

538-
|--region string
539-
|Use a specific AWS region, overriding the AWS_REGION environment variable.
596+
|-y, --yes
597+
|Automatically answer yes to confirm operation.
598+
599+
|===
600+
601+
For more information about the OCM role created with the `rosa create ocm-role` command, see _Account-wide IAM role and policy reference_.
602+
603+
[id="rosa-create-user-role_{context}"]
604+
== create user-role
605+
606+
Create the required user-role resources for your cluster.
607+
608+
.Syntax
609+
[source,terminal]
610+
----
611+
$ rosa create user-role [flags]
612+
----
613+
614+
.Flags
615+
[cols="30,70"]
616+
|===
617+
|Option |Definition
618+
619+
|--debug
620+
|Enable debug mode.
621+
622+
|-i, --interactive
623+
|Enable interactive mode.
624+
625+
|-m, --mode string
626+
a|How to perform the operation. Valid options are:
627+
628+
* `auto`: Resource changes will be automatic applied using the current AWS account
629+
* `manual`: Commands necessary to modify AWS resources will be output to be run manually
630+
631+
|--path string
632+
|The ARN path for the user role and policies.
633+
634+
|--permissions-boundary string
635+
|The ARN of the policy that is used to set the permissions boundary for the user role.
636+
637+
|--prefix string
638+
|User-defined prefix for all generated AWS resources The default is `ManagedOpenShift`.
639+
640+
|--profile string
641+
|Use a specific AWS profile from your credential file.
540642

541643
|-y, --yes
542644
|Automatically answer yes to confirm operation.
543645

544646
|===
545647

546-
For more information about the ocm-roles and the roles created with the `rosa create ocm-roles`, see the Additional resources section.
648+
For more information about the user role created with the `rosa create user-role` command, see _Understanding AWS account association_.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_getting_started_sts/rosa_creating_a_cluster_with_sts/rosa-sts-creating-a-cluster-with-customizations.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="rosa-sts-arn-path-customization-for-iam-roles-and-policies_{context}"]
7+
= ARN path customization for IAM roles and policies
8+
9+
When you create the AWS IAM roles and policies required for {product-title} (ROSA) clusters that use the AWS Security Token Service (STS), you can specify custom Amazon Resource Name (ARN) paths. This enables you to use role and policy ARN paths that meet the security requirements of your organization.
10+
11+
You can specify custom ARN paths when you create your OCM role, user role, and account-wide roles and policies.
12+
13+
If you define a custom ARN path when you create a set of account-wide roles and policies, the same path is applied to all of the roles and policies in the set. The following example shows the ARNs for a set of account-wide roles and policies. In the example, the ARNs use the custom path `/test/path/dev/` and the custom role prefix `test-env`:
14+
15+
* `arn:aws:iam::<account_id>:role/test/path/dev/test-env-Worker-Role`
16+
* `arn:aws:iam::<account_id>:role/test/path/dev/test-env-Support-Role`
17+
* `arn:aws:iam::<account_id>:role/test/path/dev/test-env-Installer-Role`
18+
* `arn:aws:iam::<account_id>:role/test/path/dev/test-env-ControlPlane-Role`
19+
* `arn:aws:iam::<account_id>:policy/test/path/dev/test-env-Worker-Role-Policy`
20+
* `arn:aws:iam::<account_id>:policy/test/path/dev/test-env-Support-Role-Policy`
21+
* `arn:aws:iam::<account_id>:policy/test/path/dev/test-env-Installer-Role-Policy`
22+
* `arn:aws:iam::<account_id>:policy/test/path/dev/test-env-ControlPlane-Role-Policy`
23+
24+
When you create the cluster-specific Operator roles, the ARN path for the relevant account-wide installer role is automatically detected and applied to the Operator roles.
25+
26+
For more information about ARN paths, see link:https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html[Amazon Resource Names (ARNs)] in the AWS documentation.

modules/rosa-sts-creating-a-cluster-using-defaults-ocm.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ endif::[]
3939

4040
. On the *Create an OpenShift cluster* page, select *Create cluster* in the *{product-title} (ROSA)* row.
4141

42-
. Review and complete the *Prerequisites* listed on the *Accounts and roles* page. Select the checkbox to acknowledge that you have read and completed all of the prerequisites.
43-
44-
. Verify that your AWS account ID is listed in the *Associated AWS accounts* drop-down menu and that the installer, support, worker, and control plane account role Amazon Resource Names (ARNs) are listed on the *Accounts and roles* page.
42+
. Verify that your AWS account ID is listed in the *Associated AWS accounts* drop-down menu and that the installer, support, worker, and control plane account role Amazon Resource Names (ARNs) are listed on the *Accounts and roles* page.
4543
+
4644
[NOTE]
4745
====

modules/rosa-sts-creating-a-cluster-with-customizations-cli.adoc

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,57 @@ To successfully install ROSA clusters, use latest version of the ROSA CLI.
4242
+
4343
[source,terminal]
4444
----
45-
$ rosa create account-roles --mode manual <1>
45+
$ rosa create account-roles --interactive \ <1>
46+
--mode manual <2>
4647
----
47-
<1> `manual` mode generates the `aws` CLI commands and JSON files needed to create the account-wide roles and policies. After review, you must run the commands manually to create the resources.
48+
<1> `interactive` mode enables you to specify configuration options at the interactive prompts. For more information, see _Interactive cluster creation mode reference_.
49+
<2> `manual` mode generates the `aws` CLI commands and JSON files needed to create the account-wide roles and policies. After review, you must run the commands manually to create the resources.
50+
+
51+
--
52+
.Example output
53+
[source,terminal]
54+
----
55+
I: Logged in as '<red_hat_username>' on 'https://api.openshift.com'
56+
I: Validating AWS credentials...
57+
I: AWS credentials are valid!
58+
I: Validating AWS quota...
59+
I: AWS quota ok. If cluster installation fails, validate actual AWS resource usage against https://docs.openshift.com/rosa/rosa_getting_started/rosa-required-aws-service-quotas.html
60+
I: Verifying whether OpenShift command-line tool is available...
61+
I: Current OpenShift Client Version: 4.11.6
62+
I: Creating account roles
63+
? Role prefix: ManagedOpenShift <1>
64+
? Permissions boundary ARN (optional): <2>
65+
? Path (optional): [? for help] <3>
66+
? Role creation mode: auto <4>
67+
I: Creating roles using 'arn:aws:iam::<aws_account_number>:user/<aws_username>'
68+
? Create the 'ManagedOpenShift-Installer-Role' role? Yes <5>
69+
I: Created role 'ManagedOpenShift-Installer-Role' with ARN 'arn:aws:iam::<aws_account_number>:role/ManagedOpenShift-Installer-Role'
70+
? Create the 'ManagedOpenShift-ControlPlane-Role' role? Yes <5>
71+
I: Created role 'ManagedOpenShift-ControlPlane-Role' with ARN 'arn:aws:iam::<aws_account_number>:role/ManagedOpenShift-ControlPlane-Role'
72+
? Create the 'ManagedOpenShift-Worker-Role' role? Yes <5>
73+
I: Created role 'ManagedOpenShift-Worker-Role' with ARN 'arn:aws:iam::<aws_account_number>:role/ManagedOpenShift-Worker-Role'
74+
? Create the 'ManagedOpenShift-Support-Role' role? Yes <5>
75+
I: Created role 'ManagedOpenShift-Support-Role' with ARN 'arn:aws:iam::<aws_account_number>:role/ManagedOpenShift-Support-Role'
76+
I: To create a cluster with these roles, run the following command:
77+
rosa create cluster --sts
78+
----
79+
<1> Specify the prefix to include in the {cluster-manager} IAM role name. The default is `ManagedOpenShift`.
80+
+
81+
[IMPORTANT]
82+
====
83+
You must specify an account-wide role prefix that is unique across your AWS account, even if you use a custom ARN path for your account roles.
84+
====
85+
+
86+
<2> Optional: Specifies a permissions boundary Amazon Resource Name (ARN) for the role. For more information, see link:https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html[Permissions boundaries for IAM entities] in the AWS documentation.
87+
<3> Specify a custom ARN path for your account-wide roles. The path must contain alphanumeric characters only and start and end with `/`, for example `/test/path/dev/`. For more information, see _ARN path customization for IAM roles and policies_.
88+
<4> Select the role creation mode. You can use `auto` mode to automatically create the account wide roles and policies. In `manual` mode, the `rosa` CLI generates the `aws` commands needed to create the roles and policies. In `manual` mode, the corresponding policy JSON files are also saved to the current directory. `manual` mode enables you to review the details before running the `aws` commands manually.
89+
<5> Creates the account-wide installer, control plane, worker and support roles and corresponding IAM policies. For more information, see _Account-wide IAM role and policy reference_.
90+
+
91+
[NOTE]
92+
====
93+
In this step, the ROSA CLI also automatically creates the account-wide Operator IAM policies that are used by the cluster-specific Operator policies to permit the ROSA cluster Operators to carry out core OpenShift functionality. For more information, see _Account-wide IAM role and policy reference_.
94+
====
95+
--
4896
+
4997
.. After review, run the `aws` commands manually to create the roles and policies. Alternatively, you can run the preceding command using `--mode auto` to run the `aws` commands immediately.
5098

@@ -168,6 +216,7 @@ I: Using arn:aws:iam::<aws_account_id>:role/ManagedOpenShift-Support-Role for th
168216
? AWS region: us-east-1
169217
? PrivateLink cluster (optional): No
170218
? Install into an existing VPC (optional): No
219+
? Select availability zones (optional): No
171220
? Enable Customer Managed key (optional): No <5>
172221
? Compute nodes instance type (optional):
173222
? Enable autoscaling (optional): No
@@ -184,12 +233,16 @@ I: To create this cluster again in the future, you can run:
184233
I: To view a list of clusters and their status, run 'rosa list clusters'
185234
I: Cluster '<cluster_name>' has been created.
186235
I: Once the cluster is installed you will need to add an Identity Provider before you can login into the cluster. See 'rosa create idp --help' for more information.
187-
I: To determine when your cluster is Ready, run 'rosa describe cluster -c <cluster_name>'.
188-
I: To watch your cluster installation logs, run 'rosa logs install -c <cluster_name> --watch'.
236+
...
189237
----
190238
<1> When creating the cluster, the listed `OpenShift version` options include the major, minor, and patch versions, for example `4.8.9`.
191-
<2> If more than one matching set of account-wide roles are available in your account for a cluster version, an interactive list of options is provided.
239+
<2> If you have more than one set of account roles in your AWS account for your cluster version, an interactive list of options is provided.
192240
<3> Optional: By default, the cluster-specific Operator role names are prefixed with the cluster name and random 4-digit hash. You can optionally specify a custom prefix to replace `<cluster_name>-<hash>` in the role names. The prefix is applied when you create the cluster-specific Operator IAM roles. For information about the prefix, see _Defining an Operator IAM role prefix_.
241+
+
242+
[NOTE]
243+
====
244+
If you specified custom ARN paths when you created the associated account-wide roles, the custom path is automatically detected. The custom path is applied to the cluster-specific Operator roles when you create them in a later step.
245+
====
193246
<4> Multiple availability zones are recommended for production workloads. The default is a single availability zone.
194247
<5> Enable this option if you are using your own AWS KMS key to encrypt the control plane, infrastructure, worker node root volumes, and PVs. Specify the ARN for the KMS key that you added to the account-wide role ARN to in the preceding step.
195248
+
@@ -230,6 +283,8 @@ $ rosa create operator-roles --mode manual --cluster <cluster_name|cluster_id> <
230283
[NOTE]
231284
====
232285
A custom prefix is applied to the Operator role names if you specified the prefix in the preceding step.
286+
287+
If you specified custom ARN paths when you created the associated account-wide roles, the custom path is automatically detected and applied to the Operator roles.
233288
====
234289

235290
. Create the OpenID Connect (OIDC) provider that the cluster Operators use to authenticate:

0 commit comments

Comments
 (0)