Skip to content

Instantly share code, notes, and snippets.

Avatar

mohit goyal goyalmohit

  • Pune, India
View GitHub Profile
View tf-backend-azure-storage.tf
terraform {
required_version = ">= 0.12, < 0.13"
backend "azurerm" {
resource_group_name = "tf-state-rg"
storage_account_name = "tfstatemohit20200930"
container_name = "azure-devops"
key = "terraform.tfstate"
}
View az-storage-account.tf
provider "azurerm" {
version = "=2.20.0"
features {}
}
resource "azurerm_resource_group" "tf-state-resource-group" {
name = "tf-state-rg"
location = "eastus2"
}
View outputs.tf
output "azuredevops_project_id" {
value = azuredevops_project.tf-example.id
description = "azure devops project id"
}
output "azuredevops_project_name" {
value = azuredevops_project.tf-example.project_name
description = "azure devops project name"
}
View tf-backend.tf
# partially complete block of code below - will not work in isolation
terraform {
required_version = ">= 0.12, < 0.13"
backend "s3" {
bucket = "terrafrom-state-20200929"
key = "azure-devops/terraform.tfstate"
region = "us-east-2"
dynamodb_table = "terraformlocks-mohit-202009292250"
View dynamodb-table.tf
terraform {
required_version = ">= 0.12, < 0.13"
}
provider "aws" {
region = "us-east-2"
}
resource "aws_dynamodb_table" "terraform-locks" {
name = "terraform-locks-mohit-20200929"
View s3-bucket.tf
terraform {
required_version = ">= 0.12, < 0.13"
}
provider "aws" {
region = "us-east-2"
}
resource "aws_s3_bucket" "terrafrom-state" {
bucket = "terrafrom-state"
View terraform-general.gitignore
# local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# .tfvars files
*.tfvars
View az-devops-azurerm-sep-variables.tf
variable "service_principal_id" {
description = "Service Principal Id"
type = string
}
variable "service_principal_key" {
description = "Service Principal Password"
type = string
}
View az-devops-azurerm-sep.tf
# partially complete code block below - will not work in isolation
resource "azuredevops_serviceendpoint_azurerm" "endpointazure" {
project_id = azuredevops_project.tf-example.id
service_endpoint_name = "azurerm_endpoint_test"
description = "Managed by Terraform"
credentials {
serviceprincipalid = var.service_principal_id
serviceprincipalkey = var.service_principal_key
}
View az-devops-build-pipeline.yml
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
You can’t perform that action at this time.