forked from bregman-arie/devops-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added additional questions to CKA and fixed some styling issues with pulumi Python code.
- Loading branch information
abregman
committed
Oct 15, 2022
1 parent
e3c34aa
commit 9d01834
Showing
6 changed files
with
466 additions
and
58 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 |
---|---|---|
@@ -1,28 +1,25 @@ | ||
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" | ||
) | ||
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") | ||
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) | ||
) | ||
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 |
---|---|---|
@@ -1,27 +1,26 @@ | ||
import pulumi | ||
import pulumi_aws as aws | ||
|
||
availableZones = pulumi_aws.get_availability_zones(state="available") | ||
availableZones = aws.get_availability_zones(state="available") | ||
|
||
aws.ec2.Subnet("NewSubnet1", | ||
vpc_id=aws_vpc["main"]["id"], | ||
cidr_block="10.0.0.0/24", | ||
availability_zone=availableZones.names[0], | ||
tags={"Name": "NewSubnet1"} | ||
) | ||
vpc_id=aws.vpc["main"]["id"], | ||
cidr_block="10.0.0.0/24", | ||
availability_zone=availableZones.names[0], | ||
tags={"Name": "NewSubnet1"} | ||
) | ||
|
||
aws.ec2.Subnet("NewSubnet2", | ||
vpc_id=aws_vpc["main"]["id"], | ||
cidr_block="10.0.1.0/24", | ||
availability_zone=availableZones.names[1] | ||
tags={"Name": "NewSubnet2"} | ||
) | ||
vpc_id=aws.vpc["main"]["id"], | ||
cidr_block="10.0.1.0/24", | ||
availability_zone=availableZones.names[1], | ||
tags={"Name": "NewSubnet2"} | ||
) | ||
|
||
aws.ec2.Subnet("NewSubnet3", | ||
vpc_id=aws_vpc["main"]["id"], | ||
cidr_block="10.0.2.0/24", | ||
availability_zone=availableZones.names[2] | ||
tags={"Name": "NewSubnet3"} | ||
) | ||
vpc_id=aws.vpc["main"]["id"], | ||
cidr_block="10.0.2.0/24", | ||
availability_zone=availableZones.names[2], | ||
tags={"Name": "NewSubnet3"} | ||
) | ||
|
||
# Run "pulumi up" | ||
# Run "pulumi up" |
Oops, something went wrong.