I am looking for a way to create Terraform plans and execute them on a mock Azure environment without provisioning any resources.
Coming from an AWS background I could use something like LocalStack and run my Terraform code upon the API provided by the LocalStack container, without the need to provision any actual resources.
Is there an equivalent for Azure?
Related
I am building a small server-less application on aws. It is a SaaS for business purposes so I am looking at ways to cater for multi-tenancy.
So far my proof-of-concepts have been single tenant and deployed via terraform.
I am thinking of using the Terraform Cloud Workspace API to create a workspace for each tenant on sign up. The work spaces would be configured to auto-apply from my production github branch.
I'm concerned that this isn't the intended usage of Terraform Cloud and that I may run into issues as the application scales.
Does anyone have any insight into the upper-limits of Terraform Cloud? I have read through some of Hashicorp's documentation but I can't find anything specific to this.
I have few resources in AWS which are launched using Terraform and some of them are manual create using AWS console. Some of the resources are launched using Cloudformation template.
I know Cloudformation designer gives you visualization of cloudformation templates. Terraform graph can provide dependent resources diagram too.
But can any service within AWS provide complete architecture and resources and dependencies for all resources launched either via CFT, Terraform or manual launch?
any service within AWS provide
There is no such AWS service or tool. There used to be AWS CloudFormer which could help a bit with this, but its not maintained any more.
Instead, as indicated in comments, you could use former2 which is a third party tool. former2 does not generate visualizations, but can reveres-engineer CFN templates from existing resources. Once having these templates you can try CFN designer to visualize them.
I am trying to use Terraform to create a Service fabric cluster in Azure.
I have created configurations for the follwoing resources using a template provided by Tvo https://github.com/TrevorVonSeggern/ServiceFabric_Terraform
This will create the reasorces in Azure however the SFC just sits on "Deploying" and the Nodes themselves never display.
There seems to be a distinct lack of configuration resources for creating a Service fabric cluster using Terraform and HashiCorp's documentation on this resource example is not as in depth as for other resources.
Provisioning with Powershell is easier as more resources to guide.
If anyone has any working examples please can you share them?
Thanks
I have managed to deploy this successfully by deploying and then going through the extensions in the ARM template. Then adding (in JSON string) in the Terraform config for VMSS
Could not find anywhere in the Terraform documentation on this resource to assist with this.
For provisioning AWS services(EC2/R53/VPC/S3/..), technology like Terraform have unreliable approach in terms of performing rollback, error handling etc.
AWS CloudFormation templates address these problems.
CloudFormation templates are used for both provisioning of aws services(like EC2/VPC/r53/S3/...) and configuration of every service.
Additionally this template approach should easily fit into scripted pipeline using Jenkins.
What is the approach for provisioning and configuration of services in Azure cloud?
Its called Azure Resource Manager (Peter gave a helpful link in the comments). You will interact with ARM through Azure powershell, Azure Cli, ARM Templates, different SDK's or just plain rest calls to create resources.
ARM Templates are the closest thing you can get to CloudFormation templates, but they dont really have all the features of CloudFormation templates.
For example, there is no preview of the changes that will happen before you run the template. some services can not be configured with ARM Templates (or some of the properties cannot be configured).
I have a wonderful terraform plan that perfectly describes my infrastructure in Google Cloud Platform, however, I have a problem: since my repository isn't perfectly private, some steps of my plan are encrypted and must be decrypted using Google Key Management Service.
This means my plan must be broken down into two terraform phases:
Setup the Google Cloud Project and create a Key Ring and Key (after this, I encrypt secrets and put them in a variables.tf file)
Apply the entire plan.
Does Terraform support a way to break down my plan into phases? How should I go around implementing this?
Though terraform enables us to automate the resources creation, some preliminary steps need to be done manually, like account creation, billing setup, etc. Similarly for Google cloud setup, the project needs to be created prior running terrform scripts since terraform google provider requires the project details.
The project creation and terraform variables for the keys (as environment variables) can be generated through shell scripts. Then the shell script and the terraform scripts can be sequenced in execution using a make file.
The below link might be helpful for you to create GCP project through shell scripts.
https://medium.com/google-cloud/how-to-automate-project-creation-using-gcloud-4e71d9a70047