Skip to content

Commit fb9b110

Browse files
authored
Merge pull request #1519 from redis/DOC-5208
RC BYOC: Fix IAM credential steps and relref
2 parents 92b4cf4 + 8d7ed2c commit fb9b110

File tree

5 files changed

+181
-167
lines changed

5 files changed

+181
-167
lines changed

content/operate/rc/subscriptions/bring-your-own-cloud/iam-resources/aws-console.md

+126-111
Original file line numberDiff line numberDiff line change
@@ -18,117 +18,117 @@ You **must not** change the configurations of provisioned resources or stop or t
1818

1919
## Step 1: Create the IAM instance policy
2020

21-
First, create a policy to use for the new instance role:
21+
The IAM instance policy controls the permissions for the instances that Redis Cloud creates in your AWS account.
2222

23-
<!-- {{< video "/images/rc/create-instance-role-policy.mp4" "Create an instance role policy" >}} -->
23+
Follow the steps to [create an IAM policy using the JSON editor](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) with the following settings:
2424

25-
1. In the AWS IAM console, go to **Policies** > **Create policy**.
26-
1. In the **JSON** tab, paste the contents of the RedisLabsInstanceRolePolicy.json policy file, shown here:
25+
- In **Specify permissions**, select **JSON**, and then enter the contents of the RedisLabsInstanceRolePolicy.json policy file:
2726

2827
{{< expand "View RedisLabsInstanceRolePolicy.json" >}}
2928
```js
30-
{
31-
"Version": "2012-10-17",
32-
"Statement": [
33-
{
34-
"Sid": "DescribeReadOnlyEc2Resources",
35-
"Effect": "Allow",
36-
"Action": [
37-
"ec2:DescribeAvailabilityZones",
38-
"ec2:DescribeRegions",
39-
"ec2:DescribeSecurityGroups",
40-
"ec2:DescribeTags",
41-
"ec2:DescribeVolumes"
42-
],
43-
"Resource": [
44-
"*"
45-
]
46-
},
47-
{
48-
"Sid": "EC2EBSActions",
49-
"Effect": "Allow",
50-
"Action": [
51-
"ec2:AttachVolume",
52-
"ec2:CreateVolume"
53-
],
54-
"Resource": [
55-
"*"
56-
],
57-
"Condition": {
58-
"StringEquals": {
59-
"ec2:ResourceTag/RedisLabsIdentifier": "Redislabs-VPC"
60-
}
61-
}
62-
},
63-
{
64-
"Sid": "SecurityGroupAccessActions",
65-
"Effect": "Allow",
66-
"Action": [
67-
"ec2:AuthorizeSecurityGroupIngress",
68-
"ec2:DeleteSecurityGroup",
69-
],
70-
"Resource": "*",
71-
"Condition": {
72-
"StringEquals": {
73-
"ec2:ResourceTag/RedisLabsIdentifier": "Redislabs-VPC"
74-
}
75-
}
76-
},
77-
{
78-
"Sid": "TagResourcesCreation",
79-
"Effect": "Allow",
80-
"Action": [
81-
"ec2:CreateTags"
82-
],
83-
"Resource": [
84-
"*"
85-
]
86-
},
87-
{
88-
"Sid": "TagResourcesDelete",
89-
"Effect": "Allow",
90-
"Action": [
91-
"ec2:DeleteTags"
92-
],
93-
"Resource": [
94-
"*"
95-
],
96-
"Condition": {
97-
"StringEquals": {
98-
"ec2:ResourceTag/RedisLabsIdentifier": "Redislabs-VPC"
99-
}
100-
}
29+
{
30+
"Version": "2012-10-17",
31+
"Statement": [
32+
{
33+
"Sid": "DescribeReadOnlyEc2Resources",
34+
"Effect": "Allow",
35+
"Action": [
36+
"ec2:DescribeAvailabilityZones",
37+
"ec2:DescribeRegions",
38+
"ec2:DescribeSecurityGroups",
39+
"ec2:DescribeTags",
40+
"ec2:DescribeVolumes"
41+
],
42+
"Resource": [
43+
"*"
44+
]
45+
},
46+
{
47+
"Sid": "EC2EBSActions",
48+
"Effect": "Allow",
49+
"Action": [
50+
"ec2:AttachVolume",
51+
"ec2:CreateVolume"
52+
],
53+
"Resource": [
54+
"*"
55+
],
56+
"Condition": {
57+
"StringEquals": {
58+
"ec2:ResourceTag/RedisLabsIdentifier": "Redislabs-VPC"
59+
}
60+
}
61+
},
62+
{
63+
"Sid": "SecurityGroupAccessActions",
64+
"Effect": "Allow",
65+
"Action": [
66+
"ec2:AuthorizeSecurityGroupIngress",
67+
"ec2:DeleteSecurityGroup"
68+
],
69+
"Resource": "*",
70+
"Condition": {
71+
"StringEquals": {
72+
"ec2:ResourceTag/RedisLabsIdentifier": "Redislabs-VPC"
10173
}
74+
}
75+
},
76+
{
77+
"Sid": "TagResourcesCreation",
78+
"Effect": "Allow",
79+
"Action": [
80+
"ec2:CreateTags"
81+
],
82+
"Resource": [
83+
"*"
10284
]
85+
},
86+
{
87+
"Sid": "TagResourcesDelete",
88+
"Effect": "Allow",
89+
"Action": [
90+
"ec2:DeleteTags"
91+
],
92+
"Resource": [
93+
"*"
94+
],
95+
"Condition": {
96+
"StringEquals": {
97+
"ec2:ResourceTag/RedisLabsIdentifier": "Redislabs-VPC"
98+
}
99+
}
103100
}
101+
]
102+
}
104103
```
105104
{{< /expand >}}
106105

106+
- In **Review and Create**, enter `RedisLabsInstanceRolePolicy` in the **Policy name** field.
107107

108-
1. Validate it and then select **Review Policy**.
109-
1. Enter **RedisLabsInstanceRolePolicy** as the policy name and then select **Create Policy**.
108+
Select **Create policy** to finish policy creation.
110109

111110
## Step 2: Create the service role
112111

113-
To create the role that uses the policy:
112+
After creating the instance role policy, you must create a role to assign the policy.
113+
114+
Follow the steps to [create a role for an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) with the following settings:
114115

115-
<!-- {{< video "/images/rc/create-cluster-node-role.mp4" "Create a cluster node role" >}} -->
116+
- In **Select trusted entity**:
117+
- **Trusted entity**: Select **AWS service**.
118+
- **Service or use case**: Select **EC2**.
119+
- **Use case**: Select **EC2**.
120+
- In **Add permissions**, select the **RedisLabsInstanceRolePolicy** you created.
121+
- In **Name, review, and create**, enter `redislabs-cluster-node-role` in the **Role name** field.
116122

117-
1. In the AWS IAM console, go to **Roles** and click **Create Role**.
118-
1. Select **AWS Service** as the trusted entity, **EC2** as the service
119-
and use case, and click **Next: Permissions**.
120-
1. Enter `RedisLabsInstanceRolePolicy` in the search box to look up the policy we just created.
121-
Select it, and click **Next: Review**.
122-
1. Name the role `redislabs-cluster-node-role` and click **Create Role**.
123+
Select **Create role** to finish role creation.
123124

124125
## Step 3: Create the user policy
125126

126-
Now create a policy to assign to the user:
127+
The user policy controls the permissions for the user that Redis Cloud uses to manage your AWS account.
127128

128-
<!-- {{< video "/images/rc/create-instance-user-policy.mp4" "Create an instance user policy" >}} -->
129+
Follow the steps to [create an IAM policy using the JSON editor](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) with the following settings:
129130

130-
1. In the AWS IAM console, go to **Policies** > **Create policy**.
131-
1. In the **JSON** tab, paste the contents of the RedisLabsIAMUserRestrictedPolicy.json policy file.
131+
- In **Specify permissions**, select **JSON**, and then enter the contents of the RedisLabsIAMUserRestrictedPolicy.json policy file:
132132

133133
{{< expand "View RedislabsIAMUserRestrictedPolicy.json" >}}
134134
```json
@@ -360,35 +360,50 @@ Now create a policy to assign to the user:
360360
```
361361
{{< /expand >}}
362362

363-
1. Validate the policy and click **Review Policy**.
364-
1. Enter `RedislabsIAMUserRestrictedPolicy` as the policy name and click **Create Policy**.
363+
- In **Review and Create**, enter `RedislabsIAMUserRestrictedPolicy` in the **Policy name** field.
364+
365+
Select **Create policy** to finish policy creation.
365366

366367
## Step 4: Create the programmatic access user
367368

368-
Create a user and attach the policy you created:
369+
After you create the user policy, you must create a programmatic access user and attach the policy to it.
370+
371+
Follow the steps to [create a user on the AWS console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html), with the following settings:
372+
373+
- In **Specify user details**, For **User name**, enter `redislabs-user`.
374+
- In **Set permissions**:
375+
- **Permissions options**: Select **Attach existing policies directly**.
376+
- **Permissions policies**: Select the **RedislabsIAMUserRestrictedPolicy** you created from the list.
377+
378+
Select **Create user** to create the user.
369379

370-
<!-- {{< video "/images/rc/create-programmatic-user.mp4" "Create programmatic user" >}} -->
380+
After you create the user, you need to add an access key for the user.
371381

372-
1. In the AWS IAM console, go to **Users** > select **Add user**.
373-
1. Name it `redislabs-user` and check only the **Programmatic access** checkbox.
374-
1. Click **Next: Permissions**.
375-
1. Select **Attach existing policies directly** and select
376-
**RedislabsIAMUserRestrictedPolicy** from the list.
377-
1. Click **Next: Review**.
378-
1. Click **Create user**.
379-
1. Download the user credentials and store them in a secure location.
382+
Follow the steps to [create an access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-keys-admin-managed.html#admin-create-access-key) for the user you just created. Save the access key ID and secret access key in a secure location.
380383

381384
## Step 5: Create the console access role
382385

383-
Last, create a role and attach the policy you created:
386+
The console access role controls the permissions for the user that Redis Cloud uses to access the AWS console.
387+
388+
Follow the steps to [Create a role for an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html) with the following settings:
389+
390+
- In **Select trusted entity**:
391+
- **Trusted entity**: Select **AWS account**.
392+
- **An AWS account**: Select **Another AWS account**.
393+
- **Account ID**: Enter account number `168085023892` (Redis Cloud's AWS account).
394+
- **Options**: Select **Require MFA**.
395+
{{< warning >}}
396+
Do not check the **Require external ID** checkbox.
397+
{{< /warning >}}
398+
- In **Add permissions**, select the **RedisLabsInstanceRolePolicy** you created.
399+
- In **Name, review, and create**, enter `redislabs-role` in the **Role name** field.
400+
401+
Select **Create role** to finish role creation. Save the Role name for later.
402+
403+
## Next steps
384404

385-
<!-- {{< video "/images/rc/create-console-access-role.mp4" "Create console access user" >}} -->
405+
When you've finished creating all of the resources, you can [create a Cloud Account]({{< relref "/operate/rc/subscriptions/bring-your-own-cloud/cloud-account-settings" >}}) in the Redis Cloud console. To do this, you'll need the following information:
386406

387-
1. In the AWS IAM console, go to **Roles** > select **Create role**.
388-
1. Select **Another AWS account**.
389-
1. Under **Account ID**, enter account number `168085023892` (Redis Cloud's AWS account).
390-
1. Under Options, check the **Require MFA** checkbox only. *Do not check Require external ID*.
391-
1. Click **Next: Permissions**.
392-
1. Attach the policy **RedisLabsIAMUserRestrictedPolicy** to the role.
393-
1. Click **Next: Review**.
394-
1. Name the role `redislabs-role` and then click **Create role**.
407+
- **Access Key ID**: The Access Key ID for the [programmatic user you created](#step-4-create-the-programmatic-access-user).
408+
- **Secret Access Key**: The Secret Access Key for the [programmatic user you created](#step-4-create-the-programmatic-access-user).
409+
- **IAM Role Name**: The name of the [console access role you created](#step-5-create-the-console-access-role).

content/operate/rc/subscriptions/bring-your-own-cloud/iam-resources/cloudformation.md

+31-41
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,57 @@ categories:
88
- rc
99
linkTitle: CloudFormation
1010
---
11-
The following link uses [AWS CloudFormation](https://aws.amazon.com/cloudformation/) to create a stack using the AWS console:
11+
You can use [AWS CloudFormation](https://aws.amazon.com/cloudformation/) to create the IAM resources for Redis Cloud Bring your Own Cloud (BYOC).
12+
13+
{{< warning >}}
14+
We use the provided credentials to configure your AWS environment and provision required resources.
15+
16+
You **must not** change the configurations of provisioned resources or stop or terminate provisioned instances. If you do, your databases will be inaccessible and Redis will not be able to ensure database stability. See [Avoid service disruption]({{< relref "/operate/rc/subscriptions/bring-your-own-cloud/cloud-account-settings#avoid-service-disruption" >}}) for more details.
17+
{{< /warning >}}
18+
19+
## Create resources using CloudFormation on the AWS Console
20+
21+
The following link uses CloudFormation to create a stack using the AWS console:
1222

1323
<a href="https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=RedisCloud&templateURL=https://s3.amazonaws.com/iam-resource-automation-do-not-delete/RedisCloud.yaml">
1424
<img alt="Launch RedisCloud template" src="https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png"/>
1525
</a>
1626

17-
You can then use the `Outputs` tab to find the data needed to complete the creation of a Cloud Account. For the `accessSecretKey` (i.e. user's access key) and `consolePassword` (user's console password) you'll have to follow the links to the AWS Secrets Manager service, and use that to find the secret values. These values, being secrets, aren't displayed directly by CloudFormation.
27+
When the stack finishes, select the stack and then the **Outputs** tab. You need the following information to [create a Cloud Account]({{< relref "/operate/rc/subscriptions/bring-your-own-cloud/cloud-account-settings" >}}) in the Redis Cloud console:
28+
29+
- **Access Key ID**: The `accessKeyId` output.
30+
- **Secret Access Key**: Follow the link to AWS Secrets Manager in the `accessSecretKey` output and select **Retrieve secret value**.
31+
- **IAM Role Name**: The `IAMRoleName` output.
1832

19-
You can use the AWS command-line interface (CLI) if you prefer:
33+
## Create resources using CloudFormation through AWS CLI
34+
35+
You can also use the AWS command-line interface (CLI) to create the stack:
2036

2137
``` shell
22-
export AWS_PROFILE=YOUR_PROFILE_HERE
2338
aws cloudformation create-stack --stack-name RedisCloud --template-url \
2439
https://s3.amazonaws.com/iam-resource-automation-do-not-delete/RedisCloud.yaml \
2540
--capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_NAMED_IAM CAPABILITY_IAM
2641
```
2742

28-
Update the values of `AWS_PROFILE` with your profile credentials.
29-
30-
Additional options are described in the [AWS CLI docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).
31-
3243
You can track the status of the cloud formation with the following command:
3344

34-
``` console
45+
```shell
3546
aws cloudformation describe-stacks --stack-name RedisCloud
3647
```
37-
The data needed to complete the creation of a Cloud Account is shown as `Output Key` and `Output Value` pairs.
3848

39-
For the two secrets (`accessSecretKey` and `consolePassword`) you'll need to use the AWS secretmanager CLI - the value you'll need has a key of `SecretString`:
49+
After the stack finishes, you can retrieve the outputs from the `Outputs` section of the response.
4050

41-
``` console
42-
aws secretsmanager get-secret-value --secret-id=/redislabsuser/secret_access_key
43-
```
44-
45-
We recommend using yaml output for the `consolePassword`, as it makes decoding the required value easier.
46-
47-
``` console
48-
aws secretsmanager get-secret-value --secret-id=/redislabsuser/password --output yaml
49-
```
50-
51-
The `consolePassword` is a JSON object containing a single member whose key is `password` and whose value is the password. This can be a bit complex to parse out. Here's an example output:
52-
53-
```
54-
user@example-computer ~ % aws secretsmanager get-secret-value
55-
--secret-id=/redislabsuser/password
56-
--output yaml
57-
ARN: arn:aws:secretsmanager:middle-earth-1:913769183952:secret:/redislabsuser/password-qaEMYs
58-
CreatedDate: '2021-06-16T06:27:53.402000-06:00'
59-
Name: /redislabsuser/password
60-
SecretString: '{"password":"S3cr3tP@$$w0rd"}'
61-
VersionId: 00000000-0000-0000-0000-000000000000
62-
VersionStages:
63-
- AWSCURRENT
64-
```
51+
You need the following information to [create a Cloud Account]({{< relref "/operate/rc/subscriptions/bring-your-own-cloud/cloud-account-settings" >}}) in the Redis Cloud console:
6552

66-
The JSON object is the value (less the single quotes) of the `SecretString` key. i.e. it is <nobr>`{"password":"S3cr3tP@$$w0rd"}`</nobr>.
53+
- **Access Key ID**: The `accessKeyId` output.
54+
- **Secret Access Key**: Extract the secret ID from the `accessSecretKey` output. The secret ID is the `name` query parameter in the `accessSecretKey` output.
6755

68-
The password is the value associated with that key (less the double quotes): `S3cr3tP@$$w0rd`.
56+
For example, if the `accessSecretKey` output is `https://console.aws.amazon.com/secretsmanager/home?region=<region>/secret?name=/redislabsuser/secret_access_key`, then the secret ID is `/redislabsuser/secret_access_key`.
6957

70-
{{< warning >}}
71-
We use the provided credentials to configure your AWS environment and provision required resources.
58+
Use the secret ID to retrieve the secret value using the AWS secretsmanager CLI:
7259

73-
You **must not** change the configurations of provisioned resources or stop or terminate provisioned instances. If you do, your databases will be inaccessible and Redis will not be able to ensure database stability. See [Avoid service disruption]({{< relref "/operate/rc/subscriptions/bring-your-own-cloud/cloud-account-settings#avoid-service-disruption" >}}) for more details.
74-
{{< /warning >}}
60+
``` shell
61+
aws secretsmanager get-secret-value --secret-id=<accessSecretKey-ID>
62+
```
63+
Replace `<accessSecretKey-ID>` with the secret ID you extracted from the `accessSecretKey` output.
64+
- **IAM Role Name**: The `IAMRoleName` output.

0 commit comments

Comments
 (0)