Add go.mod. Update README.md file. Signed-off-by: Scott S. Lowe <scott.lowe@scottlowe.org> |
||
|---|---|---|
| .. | ||
| go.mod | ||
| main.go | ||
| README.md | ||
Using the Default AWS Infrastructure
This set of files provides an example on how to use the "default AWS infrastructure" (the VPC, subnets, and Internet gateway that are automatically created for you in a region when you start using AWS).
This example uses Go.
Contents
-
go.mod: This file contains dependencies used by this Go program. -
main.go: This Go file contains all the necessary Pulumi code to launch an EC2 instance on your default AWS infrastructure. -
README.md: This file you're currently reading.
Instructions
These instructions assume you've already installed and configured Pulumi and all necessary dependencies (Go, for this example). Please refer to the Pulumi documentation for more details on installation or configuration.
-
Start a new Pulumi project, configured for AWS and Go (you can use
pulumi newfor this step if you prefer). -
Copy
main.goandgo.modfrom this directory into the directory for the new Pulumi project. -
Run
go mod tidyin the directory where you copiedmain.goandgo.mod. -
Edit
main.goas outlined below in the section "Providing Your Own Information". -
Once
main.gohas been appropriately customized for your specific environment, runpulumi upand follow the prompts.
Enjoy!
Providing Your Own Information
The main.go file provided in this folder will not work without providing your own information. This section outlines the changes that need to be made to the main.go file.
-
On line 82, verify the AMI ID specified there (everything before
_VERIFY_ME) is valid for the AWS region you will use. Change this as necessary to a valid AMI ID for your region. -
On line 83, verify the instance type (everything before
_VERIFY_ME) is valid for your AWS region. Change as necessary. -
On line 85, replace
CHANGE_MEwith the name of a valid key pair.
After making these changes, you should be able to run pulumi up without any issues.
License
This content is licensed under the MIT License.