-
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.
- Loading branch information
Showing
6 changed files
with
54 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Description: CloudFormation LocalStack Demo | ||
|
||
Parameters: | ||
BucketName: | ||
Type: String | ||
Description: Name of the S3 bucket to create | ||
|
||
Resources: | ||
MyBucket: | ||
Type: AWS::S3::Bucket | ||
Properties: | ||
BucketName: my-cloudformation-bucket | ||
BucketName: !Ref BucketName | ||
|
||
Outputs: | ||
S3BucketName: | ||
Description: "Name of the S3 bucket" | ||
Value: !Ref MyBucket | ||
Export: | ||
Name: !Sub "${AWS::StackName}-S3BucketName" |
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,8 @@ | ||
# Pulumi | ||
|
||
## Setup | ||
|
||
```sh | ||
pip install -r requirements.txt | ||
pulumi up | ||
``` |
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,19 @@ | ||
#!/usr/bin/env bun | ||
|
||
import { $ } from "bun" | ||
console.log('Running CloudFormation resource check...') | ||
|
||
const awsCliVersion = (await $`aws --version`.text()).trim() | ||
console.log(`AWS CLI: ${awsCliVersion}`) | ||
|
||
if (!awsCliVersion) throw 'Invalid AWS CLI version.'; | ||
|
||
await $`pwd`.cwd("/cloudformation") | ||
|
||
const bucketName = 'my-cloudformation-bucket' | ||
await $`aws cloudformation create-stack --stack-name my-stack --template-body file://template.yaml --parameters ParameterKey=BucketName,ParameterValue=${bucketName}` | ||
await $`aws cloudformation describe-stacks --stack-name my-stack` | ||
|
||
console.log(`Checking if S3 bucket ${bucketName} exists...`) | ||
|
||
await $`aws s3 ls s3://${bucketName}` |
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,19 +1,21 @@ | ||
#!/usr/bin/env bun | ||
|
||
import { $ } from "bun" | ||
console.log('Running Pulumi resource check...') | ||
console.log('Running Terraform resource check...') | ||
|
||
const pulumiVersion = (await $`pulumi version`.text()).trim() | ||
console.log(`Pulumi: ${pulumiVersion}`) | ||
const terraformVersion = (await $`terraform version`.text()).trim() | ||
console.log(`Terraform: ${terraformVersion}`) | ||
|
||
if (!pulumiVersion) throw 'Invalid Pulumi version.'; | ||
if (!terraformVersion) throw 'Invalid Terraform version.'; | ||
|
||
const awsCliVersion = (await $`aws --version`.text()).trim() | ||
console.log(`AWS CLI: ${awsCliVersion}`) | ||
|
||
if (!awsCliVersion) throw 'Invalid AWS CLI version.'; | ||
|
||
const bucketName = (await $`pulumi stack output bucket_name`.text()).trim() | ||
await $`pwd`.cwd("/terraform") | ||
|
||
const bucketName = (await $`terraform output bucket_name`.text()).trim() | ||
console.log(`Checking if S3 bucket ${bucketName} exists...`) | ||
|
||
await $`aws s3 ls s3://${bucketName}` |