Giter VIP home page Giter VIP logo

learn-terraform's Introduction

HCP Terraform Getting Started Guide Example

This is an example Terraform configuration intended for use with the HCP Terraform Getting Started Guide.

What will this do?

This is a Terraform configuration that will create an EC2 instance in your AWS account.

When you set up a Workspace on HCP Terraform, you can link to this repository. HCP Terraform can then run terraform plan and terraform apply automatically when changes are pushed. For more information on how HCP Terraform interacts with Version Control Systems, see our VCS documentation.

What are the prerequisites?

You must have an AWS account and provide your AWS Access Key ID and AWS Secret Access Key to HCP Terraform. HCP Terraform encrypts and stores variables using Vault. For more information on how to store variables in HCP Terraform, see our variable documentation.

The values for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY should be saved as environment variables on your workspace.

learn-terraform's People

Contributors

brianmmcclain avatar duplo83 avatar hashicorp-copywrite[bot] avatar judithpatudith avatar ritsok avatar robin-norwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-terraform's Issues

AWS Credential Issue Hanging

Hello,

Playing with TFC, I noticed when there was an issue with AWS credentials, I used short-lived credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). The terraform plan just hung there without showing any clue what was wrong.

Raw log downloaded:

Terraform v1.6.2
on linux_amd64
Initializing plugins and modules...
{"@Level":"info","@message":"Terraform 1.6.2","@module":"terraform.ui","@timestamp":"2023-12-15T21:14:55.531419Z","terraform":"1.6.2","type":"version","ui":"1.2"}

------------ System Message ------------
Force cancel received. The operation will now be aborted.

------------ System Message ------------
Force cancel received. The operation will now be aborted.

------------ System Message ------------
Force cancel received. The operation will now be aborted.

------------ System Message ------------
Force cancel received. The operation will now be aborted.

ADD index.html and data.sh

resource "aws_instance" "web" {
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
key_name = aws_key_pair.deployer.key_name
user_data = file("data.sh")
vpc_security_group_ids = [
aws_security_group.allow_ssh.id,
aws_security_group.allow_http.id
]
I have the data.sh file in the repository, and I also have the index.html file. When Terraform runs, it applies the data.sh file, but for some reason, it doesn't apply the index.html file that is located in the same repository. Do I need to add something else for it to also take into account the index.html file?
#! /bin/bash
sudo apt update
sudo apt install -y nginx
sudo rm /var/www/html/index.nginx-debian.html
sudo cp index.html /var/www/html/
sudo systemctl start nginx
sudo systemctl enable nginx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.