forked from bregman-arie/devops-exercises
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03a92d5
commit 48db2d4
Showing
6 changed files
with
257 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Create buckets | ||
|
||
## Objectives | ||
|
||
1. Create the following buckets: | ||
1. Private bucket | ||
1. eu-west-2 region | ||
2. Upload a single file to the bucket. Any file. | ||
2. Public bucket | ||
1. eu-west-1 region | ||
2. Versioning should be enabled | ||
|
||
## Solution | ||
|
||
Click [here](solution.md) to view the solution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pulumi | ||
import pulumi_aws as aws | ||
|
||
# Private Bucket | ||
private_bucket = aws.s3.Bucket("my-first-private-bucket", | ||
acl="private", | ||
tags={ | ||
"Environment": "Exercise", | ||
"Name": "My First Private Bucket"}, | ||
region="eu-west-2" | ||
) | ||
|
||
# Bucket Object | ||
|
||
aws.s3.BucketObject("bucketObject", | ||
key="some_object_key", | ||
bucket=private_bucket.id, | ||
content="object content") | ||
|
||
# Public Bucket | ||
aws.s3.Bucket("my-first-public-bucket", | ||
acl="private", | ||
tags={ | ||
"Environment": "Exercise", | ||
"Name": "My First Public Bucket"}, | ||
region="eu-west-1", | ||
versioning=aws.s3.BucketVersioningArgs(enabled=True) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Create buckets | ||
|
||
## Objectives | ||
|
||
1. Create the following buckets: | ||
1. Private bucket | ||
1. eu-west-2 region | ||
2. Upload a single file to the bucket. Any file. | ||
2. Public bucket | ||
1. eu-west-1 region | ||
2. Versioning should be enabled | ||
|
||
## Solution | ||
|
||
### Console | ||
|
||
For the first bucket: | ||
|
||
1. Go to S3 service in the AWS console. If not in buckets page, click on "buckets" in the left side menu | ||
2. Click on "Create bucket" | ||
3. Give a globally unique name for your bucket | ||
4. Choose the region "eu-west-2" | ||
5. Click on "Create bucket" | ||
6. Click on the bucket name | ||
7. Under "objects" click on "Upload" -> "Add files" -> Choose file to upload -> Click on "Upload" | ||
|
||
For the second bucket: | ||
|
||
1. Go to S3 service in the AWS console. If not in buckets page, click on "buckets" in the left side menu | ||
2. Click on "Create bucket" | ||
3. Give a globally unique name for your bucket | ||
4. Choose the region "eu-west-1" | ||
5. Make sure to uncheck the box for "Private bucket" to make it public | ||
6. Make sure to check the enable box for "Bucket Versioning" | ||
7. Click on "Create bucket" | ||
|
||
### Terraform | ||
|
||
Click [here](terraform/main.tf) to view the solution | ||
|
||
### Pulumi - Python | ||
|
||
Click [here](pulumi/__main__.py) to view the solution |
Oops, something went wrong.