Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dilanka-rathnasiri/launch-ec2

Pulumi infrastructure as code for launch ec2
https://github.com/dilanka-rathnasiri/launch-ec2

ec2 infrastructure-as-code pulumi typescript

Last synced: 26 days ago
JSON representation

Pulumi infrastructure as code for launch ec2

Awesome Lists containing this project

README

        

# launch-ec2
Pulumi infrastructure as code for launch ec2

### Launch an ec2
1. create a configs.yaml file with required values in the repository root
2. execute `pulumi login --local` in terminal
3. execute `pulumi install` in terminal
4. execute `export PULUMI_CONFIG_PASSPHRASE=` in terminal
5. execute `export AWS_REGION=` in terminal
6. execute `pulumi stack init ` in terminal
7. execute `pulumi preview --json` in terminal (optional)
8. execute `pulumi up --yes` in terminal

### Destroy created ec2 instance
1. execute `export PULUMI_CONFIG_PASSPHRASE=` in terminal
2. execute `export AWS_REGION=` in terminal
3. execute `pulumi destroy --yes` in terminal

### Configs.yaml file format
```yaml
AMI_NAME: # wildcard can be used
INSTANCE_NAME:
INSTANCE_TYPE:
SUBNET_ID:
SG_ID:
IAM_INSTANCE_PROFILE:
TAGS:
```

### Example configs.yaml file
```yaml
AMI_NAME: "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*"
INSTANCE_NAME: "test-instance"
INSTANCE_TYPE: "t3.nano"
SUBNET_ID: "subnet-xxxxxxxxxxx"
SG_ID: "sg-xxxxxxxxxxx"
IAM_INSTANCE_PROFILE: "test-iam-profile"
TAGS:
Name: "test-instance"
Type: "public"
Version: "v1.0.0"
```