How to show pipeline on Gitlab-managed Terraform state UI? - gitlab

I am trying out Gitlab-managed Terraform state, I managed to deploy my infrastructure with Gitlab CI/CD pipeline, but the UI is not showing the pipeline that deployed the infrastructure.
I also enable deployment environment by the environment keyword
I am running an on-premise installation of Gitlab at v15.8.0. I wrote my own .gitlab-ci.yml. Am I missing something in the pipeline that causes this bug?
I tried out the steps as described in the official documentation on Terraform MR integration. It worked as intended, but it is not relevent to the managed Terraform state UI.

Related

Can Terraform be used as a CICD to build/deploy application code in aws?

I am planning to do cicd for my AWS-ECS & lambda application, but I am confused about that can I use terraform to run my cicd pipelines for deploying when new code pushes to my git repository. I don't want to use codepiepline but yes Jenkins if require.
If anyone has built this kind of architecture then pls let me know...
I think the closest you can get to CI/CD with terraform is with GitHub actions (assuming you keep your terraform config in a git repo) & terraform cloud. This page describes it: https://learn.hashicorp.com/tutorials/terraform/github-actions
Terraform Cloud is free for up to 5 users as well. I personally do use terraform cloud since you can version your modules / infrastructure & I use jenkins to schedule the builds. I think GitHub actions could be a little simpler but haven't tried yet.

Azure Synapse Analytics - CI/CD workspace and infrastructure - Design question

I have an Azure Repos project with IaC code and ci/cd yaml pipelines to set up Azure Synapse infrastructure. Can you recommend what is right approach when I integrate the workspace to connect to git? Should I create a new project in Azure Repos for the Synapse artifacts or should I use the same repository as the infrastructure project?
I will be setting up ci/cd pipelines to deploy the azure synapse artifacts as well.
Thanks!
Here's an answer to a similar question I posted:
You'll want to follow Microsoft's guide on CI/CD with Synapse. This is a great walkthrough video for the process.
Work in your development environment and commit to your collaboration branch.
A pipeline triggers off of your workspace_publish branch, releasing your code to your next environment (preferably with an approval gate)
Continue releasing the same code to higher environments, again with approval gates.
For Azure DevOps, you can use variable groups to parameterize your pipeline. Also make sure to read through the custom parameters section on that link to parameterize parts of the template that are not parameterized by default.

Azure devops release pipeline creation using terraform

I have to create release pipeline in azure devops using terraform. I am able to create build pipeline in azure devops using terraform but for release pipeline I am not getting any resource. Can anyone help me in this? Is there any way we can create release pipelines using terraform in azure devops.
Currently Terraform provider for Azure DevOps doesn't support release pipelines. There is a PR to add this functionality, but it's WIP and hasn't been merged yet: https://github.com/microsoft/terraform-provider-azuredevops/pull/178
Did you see this instruction?
https://azuredevopslabs.com/labs/vstsextend/terraform/
I know that terraform has two stages:
terraform plan & terraform apply
Seems to me you are missing the terraform apply stage which is covered quite nicely in Exercise 3

Will ADF deployment using azure devops affect existing Pipelines/Jobs in the environment

I am implementing azure devOps in Azure Data Factory.
My development environment ADF is integrated to a git repository.
I have created a build pipeline for building artifacts when there is a change in adf_publish branch.
My next step is to deploy the ARM template artifact to the PROD environment.
Suppose there are many triggered pipelines in the PROD environment and few pipelines were running in the PROD env at the time when the DEV changes are getting deployed to PROD.
My questions are:
How the changes are deployed from DevOps to PROD environment? Will it delete and replace all the pipelines and triggers from DevOps or It will pick only the changes and update the PROD env without touching the unchanged pipelines?
Suppose a pipeline is running in PROD env at the time of deployment, what will happen to that pipeline run?
Suppose there is a triggered pipeline at 3:00 O clock and deployment starts at 2:55 and ends at 3:05. What will happen to that triggered pipeline which was supposed to run at 3:00?
Any one having a clear idea about above questions or Is there any documentation for reference to obtain answers for these questions?
I have gone through Keeping deployment mode as Incremental instead of keeping it as Complete at the time of ARM template deployment. Will that option do all the tasks which I asked above?
How the changes are deployed from DevOps to PROD environment? Will it delete and replace all the pipelines and triggers from DevOps or It will pick only the changes and update the PROD env without touching the unchanged pipelines?
It depends on the deployment mode you choose.
Deployment Mode: This specifies the deployment mode in which the Azure resources specified in the template have to be deployed.
Incremental mode handles deployments as incremental updates to the
resource group . It leaves unchanged resources that exist in the
resource group but are not specified in the template. Complete mode
deletes resources that are not in your template. Validate mode
enables you to find syntactical problems with the template before
creating actual resources. By default, incremental mode is used.
Suppose a pipeline is running in PROD env at the time of deployment,
what will happen to that pipeline run?
Your deployment will fail, and you may receive a 409 conflict error message. You could check the document Best practices for CI/CD:
Pre- and post-deployment script. Before the Resource Manager
deployment step in CI/CD, you need to complete certain tasks, like
stopping and restarting triggers and performing cleanup. We recommend
that you use PowerShell scripts before and after the deployment task.
For more information, see Update active triggers. The data factory
team has provided a script to use located at the bottom of this page.
Suppose there is a triggered pipeline at 3:00 O clock and deployment
starts at 2:55 and ends at 3:05. What will happen to that triggered
pipeline which was supposed to run at 3:00?
Similar to your second question, the pipeline should not be triggered (or in the pending state), but I still don't have an instance to test such a scenario.

Start ARM template deploy conditionally in Azure Devops

My source code is on GitHub.
I have an Azure Devops pipeline set up to build and deploy the application to an Azure subscription.
I also have the full azure environment defined in ARM templates.
I'd like to run the template deployment only when a specific folder changes in my GitHub repo.
Path triggers are only for Azure Devops repos.
Other possible solutions I investigated, but there is no clear documentation on how to achieve this exactly:
Custom condition on build or release task.
Pre-deployment conditions. Maybe artifact filters?
Pre-deployment Gates?
The ARM template deployment is idempotent, I know, but it takes a several long minutes to run even if there was no infrastructure change and I'd like to avoid that time wasted on every build.
Sounds like you have a single pipeline for both the infrastructure and application code. I have separate pipelines for each, one for infrastructure as code and other builds/pipelines for applications, NuGet package creation, etc. Perhaps split the pipeline and have the application deployment trigger after and separately from the infrastructure deployment pipeline. That way the application build and deployment can run in a more frequent cycle.

Resources