项目作者: hariby

项目描述 :
CDK app to create IAM User/Role for Amazon Braket Hands-on Workshop
高级语言: Python
项目地址: git://github.com/hariby/amazon-braket-workshop-cdk.git
创建时间: 2021-05-14T04:52:38Z
项目社区:https://github.com/hariby/amazon-braket-workshop-cdk

开源协议:Apache License 2.0

下载


Welcome to Braket Workshop CDK!

This is a CDK app which creates IAM User and IAM Role for Amazon Braket Hands-on Workshop.

Usage

How to deploy (for Admin)

From you favorite environment (e.g., AWS CloudShell or AWS Cloud9), run commands below.

1. Setting up the CDK environment

  1. sudo npm install -g aws-cdk
  2. git clone https://github.com/hariby/amazon-braket-workshop-cdk.git
  3. cd amazon-braket-workshop-cdk/
  4. python3 -m venv .venv
  5. source .venv/bin/activate
  6. pip install -r requirements.txt

2. (Optional) Synthesize into CloudFormation templates

You can specify the number of attendees (the number of IAM Users or Braket Notebooks).

  1. cdk synth --context num_users=30

3. Deploy stack(s)

As the same as cdk synth above, you can specify the number of attendees (the number of IAM Users or Braket Notebooks).
You have to specify the initial password for IAM Users (this would be updated on the initial login).

  1. cdk deploy braket-workshop-iam \
  2. --context num_users=30 \
  3. --parameters DefaultUserPassword="Braket@2020"

Wait until the CloudFormation stack became CREATE_COMPLETE. The deployment of the IAM stack takes roughly 3 minuites.

Check your AWS Account ID (12-digit numbers) or Alias to create a sign-in URL for participants:
https://*account-ID-or-alias*.signin.aws.amazon.com/console

Deployment options
Enable QPU

By default, QPUs are disabled to avoid unexpected billing in the hands-on workshop. To try QPU, you can allow access by adding a disable_qpu=false context:

  1. cdk deploy braket-workshop-iam \
  2. --context num_users=30 \
  3. --context disable_qpu=false \
  4. --parameters DefaultUserPassword="Braket@2020"
Deploying all the stacks including Braket Notebooks in 3 AWS Regions

Before deploying the Notebook Stack, please make sure you have enough limit for Amazon SageMaker Notebook Instances of ml.t3.medium. You can submit a service limit increase to AWS Support from here.

  1. cdk deploy --all \
  2. --context num_users=30 \
  3. --parameters braket-workshop-iam:DefaultUserPassword="Braket@2020"
4. Clean up
  1. cdk destroy --all

How to login (for Participants)

Workshop admin will provide 3 informations:

  • Login URL, which contains Account ID (12 digits) or account alias,
  • IAM user name: WorkshopUser-n (n = 0, …, N), and
  • Password.

The users will be asked to update password when the initial login.
<!—
The default password policy enforces the following conditions as in the document:

  • Minimum password length of 8 characters and a maximum length of 128 characters.
  • Minimum of three of the following mix of character types: uppercase, lowercase, numbers, and ! @ # $ % ^ & * ( ) _ + - = [ ] { } | ' symbols.
  • Not be identical to your AWS account name or email address.
    —>