https://github.com/aldenso/terraform-pipeline-test
Test repo for terraform jenkins pipelines
https://github.com/aldenso/terraform-pipeline-test
jenkinsfile terraform terraform-azure
Last synced: 5 months ago
JSON representation
Test repo for terraform jenkins pipelines
- Host: GitHub
- URL: https://github.com/aldenso/terraform-pipeline-test
- Owner: aldenso
- License: mit
- Created: 2021-03-09T01:26:19.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-14T20:11:57.000Z (about 4 years ago)
- Last Synced: 2024-08-02T22:19:38.191Z (8 months ago)
- Topics: jenkinsfile, terraform, terraform-azure
- Language: HCL
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - aldenso/terraform-pipeline-test - Test repo for terraform jenkins pipelines (HCL)
README
# terraform-pipeline-test
Test repo for terraform jenkins pipelines for VM creation, used in conjuntion with [jenkins-jcasc](https://github.com/aldenso/jenkins-jcasc-demo)
Minimal requirements to run manually.
- Azure Subscription (ARM_SUBSCRIPTION_ID)
- Azure Tenant (ARM_TENANT_ID)
- Azure Service Principal (ARM_CLIENT_ID)
- Azure Certificate Associated with Service Principal (ARM_CLIENT_CERTIFICATE_PATH)
- Azure Storage Account
- Azure container in storage account
- Azure Storage Account Access Key (ARM_ACCESS_KEY) - for Terraform Remote Backend.Once you have all the info export it as environment variables.
```bash
export ARM_CLIENT_ID="00000000-0000-0000-0000-000000000000"
export ARM_CLIENT_CERTIFICATE_PATH="/your/path/file.pfx"
export ARM_SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000"
export ARM_TENANT_ID="00000000-0000-0000-0000-000000000000"
export TF_VAR_username=azureuser
export TF_VAR_password=myvery01Secure@ccess # remember to follow azure password guidelines
export ARM_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
export TF_VAR_prefix=WHATYOUWANT
```**Note**: Change the backend configuration in [main.tf](main.tf) to point to your configuration.
```
# define your own storage_account_name and export ARM_ACCESS_KEY
terraform {
backend "azurerm" {
resource_group_name = "yourRG"
storage_account_name = "yourStorageAccount"
container_name = "yourcontainer"
key = "whatyouwant.tfstate"
}
}
```