Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
First version publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
suguiura-aws committed Aug 9, 2021
1 parent b05e452 commit 9b17388
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 8,077 deletions.
Binary file modified .DS_Store
Binary file not shown.
95 changes: 41 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,60 +29,7 @@ Clone or download the repository to a local directory on your linux client. Note
git clone <Git URL>
```

### Build

AWS Solutions use two buckets: a bucket for global access to templates, which is accessed via HTTPS, and regional buckets for access to assets within the region, such as Lambda code. You will need:

* One global bucket that is access via the http end point. AWS CloudFormation templates are stored here. Ex. "mybucket"
* One regional bucket for each region where you plan to deploy using the name of the global bucket as the root, and suffixed with the region name. Ex. "mybucket-us-east-1"
* Your buckets should be encrypted and disallow public access

**Build the solution**

- Declare environment variables
```
export REGION=aws-region-code # the AWS region to launch the solution (e.g. us-east-1)
export BUCKET_PREFIX=my-bucket-name # bucket where customized code will reside
export SOLUTION_NAME=my-solution-name # the solution name
export VERSION=my-version # version number for the customized code
```

- Create S3 Buckets
From the AWS CLI
```
aws s3 mb s3://$BUCKET_PREFIX --region $REGION
aws s3 mb s3://$BUCKET_PREFIX-$REGION --region $REGION
```

From the *deployment* folder in your cloned repo, run build-s3-dist.sh, passing the root name of your bucket (ex. mybucket), name of the solution i.e. aws-innovation-sandbox and the version you are building (ex. v1.3.3). We recommend using a similar version based on the version downloaded from GitHub (ex. GitHub: v1.3.3, your build: v1.3.3.mybuild)

```
chmod +x build-s3-dist.sh
source build-s3-dist.sh $BUCKET_PREFIX $SOLUTION_NAME $VERSION
```

**Upload to your buckets**

```
aws s3 sync ./global-s3-assets/ s3://$BUCKET_PREFIX/$SOLUTION_NAME/$VERSION/ --acl bucket-owner-full-control
aws s3 sync ./regional-s3-assets/ s3://$BUCKET_PREFIX-$REGION/$SOLUTION_NAME/$VERSION/ --acl bucket-owner-full-control
```
This will Upload the InnovationSandbox.template to your global bucket, and the files listed below to your regional bucket:

The following files will be copied:
- InnovationSandboxManagementAccount.template
- InnovationSandboxSbxAccount.template
- InnovationSandboxTransitGatewaySetup.template
- innovation_sbx_guardrails_scp.json
- innovation_sbx_network_controls_scp.json
- InnovationSandbox.zip


## Deploy
Get the link of the `InnovationSandbox.template` uploaded to your Amazon S3 bucket.
Deploy the Serverless Image Handler solution to your account by launching a new AWS CloudFormation stack using the S3 link of the `InnovationSandbox.template`

For more info, see the [AWS Innovation Sandbox](<URL>) for deployment instructions, using the link to the InnovationSandbox.template from your bucket, rather than the one for AWS Solutions.

#### Repository Organization

Expand Down Expand Up @@ -121,6 +68,46 @@ For more info, see the [AWS Innovation Sandbox](<URL>) for deployment instructio
```

### Build

AWS Solutions use two buckets: a bucket for global access to templates, which is accessed via HTTPS, and regional buckets for access to assets within the region, such as Lambda code. You will need:

* One global bucket that is access via the http end point. AWS CloudFormation templates are stored here. Ex. "mybucket"
* One regional bucket for each region where you plan to deploy using the name of the global bucket as the root, and suffixed with the region name. Ex. "mybucket-us-east-1"
* Your buckets should be encrypted and disallow public access

**Build the solution**

From the *deployment* folder in your cloned repo, run build-s3-dist.sh, passing the root name of your bucket (ex. mybucket), name of the solution i.e. aws-innovation-sandbox and the version you are building (ex. v1.3.3). We recommend using a similar version based on the version downloaded from GitHub (ex. GitHub: v1.3.3, your build: v1.3.3.mybuild)

```
chmod +x build-s3-dist.sh
build-s3-dist.sh <bucketname> aws-innovation-sandbox <version>
```


**Upload to your buckets**

Upload the InnovationSandbox.template to your global bucket.

Upload the files listed below to your regional bucket in the following pattern:

```
s3://mybucket-us-east-1/aws-innovation-sandbox/v1.3.3/<file name> (lambda Code)
```

InnovationSandboxManagementAccount.ts
InnovationSandboxSbxAccount.ts
InnovationSandboxTransitGatewaySetup.ts
innovation_sbx_guardrails_scp.json
innovation_sbx_network_controls_scp.json
InnovationSandbox.zip


## Deploy

See the [AWS Instance Scheduler Implementation Guide](<URL>) for deployment instructions, using the link to the instance-scheduler.template from your bucket, rather than the one for AWS Solutions.

## CDK Documentation

AWS Innovation Sandbox templates are generated using AWS CDK, for further information on CDK please refer to the [documentation](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html)
Expand All @@ -134,4 +121,4 @@ Licensed under the Apache License Version 2.0 (the "License"). You may not use t

http://www.apache.org/licenses/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and limitations under the License.
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and limitations under the License.
Binary file removed deployment/.DS_Store
Binary file not shown.
7 changes: 4 additions & 3 deletions deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ echo "--------------------------------------------------------------------------

# Move outputs from staging to template_dist_dir
echo "Move outputs from staging to template_dist_dir"
echo "cp $template_dir/*.template $template_dist_dir/"
echo "cp $staging_dist_dir/*.template $template_dist_dir/"
# cp $staging_dist_dir/InnovationSandbox.template.json $template_dist_dir/aws-innovation-sandbox.template.json
# Renaming InnovationSandbox.template to match AWS Solution Trademark name
mv $staging_dist_dir/InnovationSandbox.template.json $staging_dist_dir/aws-innovation-sandbox.template.json
cp $staging_dist_dir/*.template.json $template_dist_dir/
cp $source_dir/cloudformation_templates/* $template_dist_dir/
rm *.template.json



# Rename all *.template.json files to *.template
echo "Rename all *.template.json to *.template"
echo "copy templates and rename"
Expand Down
Empty file modified deployment/run-unit-tests.sh
100644 → 100755
Empty file.
Binary file removed source/.DS_Store
Binary file not shown.
Loading

0 comments on commit 9b17388

Please sign in to comment.