SSH into your EC2 instance. Run the following:
$ sudo yum install gcc This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
SSH into your EC2 instance. Run the following:
$ sudo yum install gcc This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
This is really just an approach for locally testing DNS changes, which can easily be done with a HOSTS file if the change involves an IP address, but gets a bit trickier when things like CNAMEs are involved. This is only meant to test locally off a single machine.
Install bind using homebrew
brew install bind
Follow the installation steps to start up bind
| resource "github_team_repository" "tf_test" { | |
| for_each = local.repo_tf_test.permission | |
| repository = github_repository.tf_test_repo.name | |
| team_id = each.key | |
| permission = each.value | |
| } |
| #!/bin/bash | |
| # start vault | |
| VAULT_UI=true vault server -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8200 | |
| # login as root - DO NOT DO THIS IN PRODUCTION | |
| vault login root | |
| # write some secrets | |
| vault kv put secret/test color=blue number=eleventeen |
| [Resolve] | |
| DNS=127.0.0.1 | |
| #FallbackDNS= | |
| Domains=~consul | |
| #LLMNR=no | |
| #MulticastDNS=no | |
| #DNSSEC=no | |
| #Cache=yes | |
| #DNSStubListener=yes |
| # Creates a "dummy" network interface | |
| # we'll configure this interface with a link-local address | |
| # See: https://www.freedesktop.org/software/systemd/man/systemd.netdev.html | |
| ## | |
| [NetDev] | |
| Name=dummy0 | |
| Kind=dummy |
| def applyRun(runid) { | |
| def response = httpRequest( | |
| customHeaders: [ | |
| [ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], | |
| [ name: "Content-Type", value: "application/vnd.api+json" ] | |
| ], | |
| httpMode: 'POST', | |
| responseBody: '{ comment: "Apply confirmed" }', | |
| url: "https://app.terraform.io/api/v2/runs/${runid}/actions/apply" | |
| ) |
| def overridePolicy(policyid) { | |
| def response = httpRequest( | |
| customHeaders: [ | |
| [ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], | |
| [ name: "Content-Type", value: "application/vnd.api+json" ] | |
| ], | |
| httpMode: 'POST', | |
| url: "https://app.terraform.io/api/v2/policy-checks/${policyid}/actions/override" | |
| ) | |
| def data = new JsonSlurper().parseText(response.content) |
| def getPlanStatus(runid) { | |
| def result = "" | |
| def response = httpRequest( | |
| customHeaders: [[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ]], | |
| url: "https://app.terraform.io/api/v2/runs/${runid}" | |
| ) | |
| def data = new JsonSlurper().parseText(response.content) | |
| switch (data.data.attributes.status) { | |
| case 'pending': | |
| result = "noop" |
| def startPlan() { | |
| def payload = buildPayload() | |
| def response = httpRequest( | |
| customHeaders: [ | |
| [ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], | |
| [ name: "Content-Type", value: "application/vnd.api+json" ] | |
| ], | |
| httpMode: 'POST', | |
| requestBody: "${payload}", | |
| url: "https://app.terraform.io/api/v2/runs" |