Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #115 from z-k-r/fix_tutorial_pr_creation
Browse files Browse the repository at this point in the history
Fix tutorial PR creation
  • Loading branch information
im2nguyen committed Sep 20, 2020
2 parents 2925dcc + 2f87d01 commit 697562e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This content is referenced on learn.hashicorp.com
# and needs review before merges as that content may break.
*.tf @hashicorp/terraform-education @mikenomitch
*.md @hashicorp/terraform-education @mikenomitch
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Terraform Cloud Getting Started Guide Example

This is an example Terraform configuration intended for use with the Terraform Cloud Getting Started Guide hosted at https://learn.hashicorp.com/terraform/cloud/tf_cloud_overview
This is an example Terraform configuration intended for use with the [Terraform Cloud Getting Started Guide](https://learn.hashicorp.com/terraform/cloud-gettingstarted/tfc_overview).

## What will this do?

This is a simple Terraform configuration that will create an empty [DynamoDB](https://aws.amazon.com/dynamodb/) table using your AWS account.

When you set up a Workspace on Terraform Cloud, you can link to this repository. Terraform Cloud can then run `terraform plan` and `terraform apply` automatically when changes are pushed. For more information on how Terraform Cloud interacts with Version Control Systems, see [our VCS documentation](https://www.terraform.io/docs/cloud/run/ui.html).

## What are the prerequisites?

You must have an AWS account and provide your AWS Access Key ID and AWS Secret Access Key to Terraform Cloud. Terraform Cloud encrypts and stores variables using [Vault](https://www.vaultproject.io/). For more information on how to store variables in Terraform Cloud, see [our variable documentation](https://www.terraform.io/docs/cloud/workspaces/variables.html).

The values for `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` should be saved as environment variables on your workspace.
12 changes: 7 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ provider "aws" {
region = var.aws_region
}

provider "random" {
version = "2.2"
}

resource "random_pet" "table_name" {}

resource "aws_dynamodb_table" "tfc_example_table" {
name = var.db_table_name
name = "${var.db_table_name}-${random_pet.table_name.id}"

read_capacity = var.db_read_capacity
write_capacity = var.db_write_capacity
Expand All @@ -21,8 +27,4 @@ resource "aws_dynamodb_table" "tfc_example_table" {
name = "UserName"
type = "S"
}

tags = {
user_name = var.tag_user_name
}
}
6 changes: 1 addition & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variable "aws_region" {

variable "db_table_name" {
type = string
default = "exampleTable"
default = "terraform-learn"
}

variable "db_read_capacity" {
Expand All @@ -17,7 +17,3 @@ variable "db_write_capacity" {
type = number
default = 1
}

variable "tag_user_name" {
type = string
}

0 comments on commit 697562e

Please sign in to comment.