- Create a workspace
- Change the execution to
local
terraform login
# Get the token from the UI and complete it
terraform init
terraform plan
terraform apply --auto-approve
# For terraform console
terraform console
Refer networking/main.tf
- Create an Internet Gateway
kafka_internet_gateway
to talk to the outside world in thevpc
- Create a route table
kafka_public_rt
in thevpc
- Configure
default_route
route tokafka_public_rt
route table in thevpc
- Associate every
subnet
to the route tablekafka_public_rt
Refer https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html
For a RHEL AMI, the user name is ec2-user or root.
In any terminal
# Generate key pair (public and private)
# this path varies on local terminal that is used
# to run tf
# and save it to /home/ec2-user/.ssh/kafkassh (no passphrase) "kafkassh" is the key name
ssh-keygen -t rsa
# Will generate pub and private keys
chmod 400 kafkassh
ssh -i "kafkassh" ec2-user@dns