Last active
August 31, 2022 00:06
-
-
Save carljavier/b040542a19c88b2529ddecc9ff0578e7 to your computer and use it in GitHub Desktop.
Terracurl API Curl Request Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
terracurl = { | |
source = "devops-rob/terracurl" | |
} | |
} | |
} | |
provider "terracurl" {} | |
resource "terracurl_request" "chucknorris" { | |
name = "chucknorris" | |
url = "https://api.chucknorris.io/jokes/random" | |
method = "GET" | |
response_codes = [200,204] | |
destroy_url = "https://api.chucknorris.io/jokes/random" | |
destroy_method = "GET" | |
destroy_response_codes = [200,204] | |
} | |
output "chucknorris-joke" { | |
value = jsondecode(terracurl_request.chucknorris.response) | |
} |
Author
carljavier
commented
Jul 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment