This file contains hidden or 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
my-resource-1: | |
current_version: 1.9.0 | |
product: my-manually-set-product | |
my-resource-2: | |
current_version: ${api.current_version} | |
product: ${api.product} |
This file contains hidden or 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
my-data-123: | |
is_enabled: true | |
amount: 100 | |
tier: premium | |
subnets: | |
- item | |
tags: | |
test: test-tag |
This file contains hidden or 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
workspace-1: | |
environments: | |
dev: {} | |
test: | |
variables: | |
ws-1-top-var-1: | |
value: ws 1 test var value | |
prod: | |
variables: | |
WS-1-PROD-VAR: |
This file contains hidden or 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
import json | |
def filter_data(data, filter): | |
return {k: v for k, v in data.items() if eval(filter)} | |
data = { | |
'my-common-account-dev': { | |
'id': '111', |
This file contains hidden or 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
$files = Get-ChildItem -Recurse -Filter '*.json' -Path 'Users' | |
$delimit = '---' | |
foreach ($file in $files) { | |
$yamlFileName = Join-Path $file.DirectoryName "$($file.BaseName).yaml" | |
$content = Get-Content $file -Raw | |
if ($content -match $delimit) { | |
$yamlDocs = $content.split($delimit) | ForEach-Object { $_ | ConvertFrom-Json -Depth 5 | ConvertTo-Yaml } | |
$yamlStr = $yamlDocs -join "$delimit`n" |
This file contains hidden or 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
variable "environment" { | |
default = "prod" | |
} | |
locals { | |
prefix_folder = "/environments/${var.environment}" | |
folders = { | |
accounts : "accounts" | |
iam_users : "iam_users" |
This file contains hidden or 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
import requests | |
import json | |
def get_latest_commit_sha(base_url, headers, owner, repo, branch='main'): | |
url = f'{base_url}/repos/{owner}/{repo}/branches/{branch}' | |
return requests.get(url, headers=headers).json()['commit']['sha'] | |
def get_base_tree_sha(base_url, headers, owner, repo, sha): |
This file contains hidden or 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
config: | |
name: "this is ${env} config" |
This file contains hidden or 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
BeforeDiscovery { | |
$testCases = Get-ChildItem -Path (Join-Path $PSScriptRoot examples) -Directory | |
} | |
describe 'terraform-module-storage - <_.Name>' -ForEach $testCases { | |
BeforeAll -ErrorAction Stop { | |
$exampleName = $_ | |
Push-Location $exampleName | |
Write-Host "Test case: $($ExampleName.Name)" -Foreground Magenta |
This file contains hidden or 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
$devOpsProjects = (az devops project list | ConvertFrom-Json).value | |
foreach ($i in $devOpsProjects) { | |
Write-Output "importing $($i.name)" | |
$command = @" | |
terraform import 'azuredevops_project.project[\"$($i.name)\"]' "$($i.id)" | |
"@ | |
Invoke-Expression $command | |
} |
NewerOlder