Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for aws-cli prerequisite #537

Merged
merged 2 commits into from Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/_docs/extras/minimal-deploy-iam.md
Expand Up @@ -50,7 +50,7 @@ Here's a summary of the commands:
}
EOF
aws iam put-group-policy --group-name Jets --policy-name JetsPolicy --policy-document file:///tmp/jets-iam-policy.json

If your environment requires a "least privilege" approach, these commands will create a policy that has been reported to work well:

aws iam create-group --group-name Jets
Expand Down Expand Up @@ -169,6 +169,23 @@ Finally, create a user and add the user to IAM group. Here's an example:
aws iam create-user --user-name tung
aws iam add-user-to-group --user-name tung --group-name Jets

## Alternately create policy, group, and user in AWS console

The above steps can alternately be created in AWS Console.

Go to [IAM Policies](https://console.aws.amazon.com/iam/home?nc2=h_m_sc#/policies).
Click "Create policy", then "JSON", then "Next: tags", then "Next: review".
Name the policy "JetsPolicy" and click "Create policy".

Go to [IAM Groups](https://console.aws.amazon.com/iam/home?nc2=h_m_sc#/groups).
Click "Create new group". Name the group "Jets" and click "Next step".
Search for "JetsPolicy", check its checkbox, click "Next step", then "Create group".

Go to [IAM Users](https://console.aws.amazon.com/iam/home?nc2=h_m_sc#/users).
Click "Add user". Give the user a name and check "Programmatic access".
Click "Next: permissions". Check the "Jets" group to add user to group.
Click "Next: tags", "Next: Review", then "Create user".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if this would be an extra benefit but ran through it and documented just in case.

Is it typical that users would have their aws CLI configured first with like their root credentials, then create the policy, group, and user from CLI, then override aws configure using that user's credentials for jets?

It made a little more intuitive sense to me to sequence things by doing the IAM work in AWS console as root, then configure the CLI using the new IAM credentials. But I'm pretty inexperienced with this, hoping to learn more!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it’s good to have console instructions also. Prefer it on a separate page and the pages cross link to each other.

## Additional IAM Permissions

The baseline IAM policy above might not include all the permissions required depending on what your Jets application does. For example, if you are using [AWS Config Rules]({% link _docs/extras/config-rules.md %}) or [Custom Resources]({% link _docs/custom-resources.md %}), then you would need to add permissions specific to those resources. This is why an IAM group is recommended. You simply have to update the group policies.
Expand Down
27 changes: 26 additions & 1 deletion docs/_docs/install.md
Expand Up @@ -12,9 +12,34 @@ Install jets via RubyGems.

Jets works on macosx and linux variants. Jets does not work on windows. For windows, recommend considering [Cloud9 IDE](https://aws.amazon.com/cloud9/). There are some nice advantages like [Faster Development](https://rubyonjets.com/docs/faster-development/).

### IAM policy, group, and user

The IAM user you use to run the `jets deploy` command
needs a minimal set of IAM policies in order to deploy a Jets application.
Follow the [Minimal Deploy Policy IAM Policy](/docs/extras/minimal-deploy-iam)
to create the policy, group, and user.

Use the user's credentials to configure the `aws-cli` below.

### aws-cli

Install the [aws-cli](https://aws.amazon.com/cli/) using your method of choice.
For example, with Homebrew on macOS:

brew install awscli

Configure it:

aws configure

Use the user's Access Key ID and Secret Access Key from the IAM steps above.

### Ruby

Jets supports Ruby 2.5 and Ruby 2.7. Patch variants of it should work. More details: [Using Different Ruby Versions]({% link _docs/extras/ruby-versions.md %}).
Jets supports Ruby 2.5 and Ruby 2.7,
which are the Ruby versions supported by AWS Lambda.
Patch variants of it should work.
More details: [Using Different Ruby Versions]({% link _docs/extras/ruby-versions.md %}).

### Yarn

Expand Down
2 changes: 2 additions & 0 deletions docs/quick-start.md
Expand Up @@ -6,6 +6,8 @@ In a hurry? No problem! Here's a quick start to get going.

## Local Testing

Review prerequisites on the [Install](/docs/install) page. Then:

gem install jets
jets new demo
cd demo
Expand Down