Skip to content

slalom-consulting-ltd/tf-provider-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf-provider-demo

This is a demo showing how to build a custom terraform provider to tag your cloud resources. To do so, you will need an api first. In the ./aws folder, you will find the terraform files to create a simple REST api with aws api gateway, lambda and dynomadb.

bash-3.2$ terraform init 

Initializing the backend...

Initializing provider plugins...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
bash-3.2$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.metadata_tags.test: Refreshing state...

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
bash-3.2$ terraform apply
data.metadata_tags.test: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

test = {
  "id" = "tag-1603843782"
  "path" = "/v1/tag"
  "query_string" = "abc"
  "tags" = {
    "hostname" = "📛 hostname"
    "id" = "1"
    "meta" = "📝 Blablablablabla, blabla bla blablablabla blabla blablablablablabla"
    "name" = "🗿"
    "owner" = "🐻 owner"
    "region" = "📍 home"
    "tag" = "abc"
  }
}

How to build it?

$ go build -o terraform-provider-metadata .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 49.1%
  • Go 34.1%
  • Python 16.0%
  • Shell 0.8%