Skip to content

Commit 40592e5

Browse files
authored
[CDS-112532] Azure connector support for terraform (#11488)
* [CDS-112532] Azure connector support for terraform * update * update
1 parent d25f881 commit 40592e5

File tree

3 files changed

+114
-5
lines changed

3 files changed

+114
-5
lines changed

docs/continuous-delivery/cd-infrastructure/terraform-infra/run-a-terraform-plan-with-the-terraform-apply-step.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,13 @@ This allows you to specify a different workspace name each time the Pipeline is
269269

270270
You can even set a Harness Trigger where you can set the workspace name used in **Workspace**.
271271

272-
## AWS Connector Provider Credential Authentication for Terraform Plan and Apply Steps
272+
## Connector Credentials
273+
274+
You can use a connector to authenticate with the target cloud provider. This is an optional configuration that takes the connector reference. The Terraform step uses this connector to authenticate with the cloud provider targeted for infrastructure provisioning.
275+
276+
This connector configuration is available in the **Terraform Apply** step when the **Configuration Type** is set to **Inline**.
277+
278+
### AWS Connector
273279

274280
:::note
275281
This feature requires Harness Delegate version 81202. This feature is available only to paid customers. Contact [Harness Support](mailto:[email protected]) to enable the feature.
@@ -281,6 +287,9 @@ By default, AWS assumes the role session duration as 900 seconds. To increase th
281287

282288
When configured the optional configuration for AWS Connector these fields can be passed as a fixed value, runtime input, or an expression
283289

290+
<details>
291+
<summary>Sample YAML</summary>
292+
284293
```YAML
285294
- step:
286295
type: TerraformApply
@@ -301,6 +310,7 @@ When configured the optional configuration for AWS Connector these fields can be
301310
roleArn: <+input>
302311
timeout: 10m
303312
```
313+
</details>
304314
305315
#### Terraform variable files
306316
@@ -338,6 +348,49 @@ In **File Paths**, add one or more file paths from the root of the bucket to the
338348
339349
Click **Submit**. The remote file(s) are added.
340350
351+
### Azure Connector
352+
353+
Harness Terraform steps now support authenticating with Azure using Azure connectors for target provisioning. This enables seamless integration with Azure infrastructure when running Terraform Plan, Apply, and Destroy steps with inline Terraform configuration.
354+
355+
#### Key Features
356+
357+
- **Azure Connector support:** Authenticate Terraform operations using Azure connectors configured in Harness.
358+
- **Authentication methods:** Manual credentials, Delegate-based credentials, OIDC token-based authentication are supported. Certificate-based authentication is **not supported** yet.
359+
- **Additional options:** Default configuration can be overridden with environment variables like ARM_TENANT_ID and ARM_MSI_ENDPOINT for advanced scenarios.
360+
361+
For more information on how to setup an Azure connector, go to [Azure Connector Settings Reference](/docs/platform/connectors/cloud-providers/add-a-microsoft-azure-connector).
362+
363+
#### YAML Configuration Example
364+
365+
<details>
366+
<summary>Sample YAML</summary>
367+
368+
```yaml
369+
- step:
370+
type: TerraformPlan
371+
name: TerraformPlan_1
372+
identifier: TerraformPlan_1
373+
spec:
374+
provisionerIdentifier: planoidc
375+
configuration:
376+
command: Apply
377+
configFiles:
378+
store:
379+
spec:
380+
connectorRef: githubConnector
381+
repoName: play
382+
gitFetchType: Branch
383+
branch: main
384+
folderPath: tf/azure
385+
type: Github
386+
providerCredential:
387+
type: Azure
388+
spec:
389+
connectorRef: AzureConnector
390+
subscriptionId: 20xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
391+
```
392+
</details>
393+
341394
## Backend configuration
342395
343396
The **Backend Configuration** section contains the [remote state](https://www.terraform.io/docs/language/state/remote.html) values.

docs/continuous-delivery/cd-infrastructure/terraform-infra/run-a-terraform-plan-with-the-terraform-plan-step.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,20 +272,32 @@ This allows you to specify a different workspace name each time the Pipeline is
272272

273273
You can even set a Harness Trigger where you can set the workspace name used in **Workspace**.
274274

275-
## AWS Connector Provider Credential Authentication for Terraform Plan and Apply Steps
275+
## Connector Credentials
276+
277+
You can use a connector to authenticate with the target cloud provider. This is an optional configuration that takes the connector reference. The Terraform step uses this connector to authenticate with the cloud provider targeted for infrastructure provisioning.
278+
279+
This connector configuration is available in the **Terraform Plan** step. It also appears in the **Terraform Apply** and **Terraform Destroy** steps when the **Configuration Type** is set to **Inline**.
280+
281+
<div align="center">
282+
<DocImage path={require('./static/connector-credentials.png')} width="60%" height="60%" title="Click to view full size image" />
283+
</div>
284+
285+
### AWS Connector
276286

277287
:::note
278288
This feature requires Harness Delegate version 81202. This feature is available only to paid customers. Contact [Harness Support](mailto:[email protected]) to enable the feature.
279289
:::
280290

281-
282291
You can use an AWS connector to have the Terraform Plan and Apply step assume a role to perform infrastructure provisioning. It's an optional configuration that takes the AWS connector, a region and Role ARN. The Terraform step uses these parameters to authenticate the AWS account targeted for infrastructure provisioning.
283292

284293
By default, AWS assumes the role session duration as 900 seconds. To increase the AWS role session duration, a built-in environment variable, `HARNESS_AWS_ASSUME_ROLE_DURATION` is introduced, which can be used to override the assume role session duration. `HARNESS_AWS_ASSUME_ROLE_DURATION` is designed for use in Terraform steps in the environment variable section. The value must be set in seconds. This new environment variable requires Harness Delegate version 82700.
285294

286-
When configured the optional configuration for AWS Connector these fields can be passed as a fixed value, runtime input, or an expression
295+
When configured the optional configuration for AWS Connector these fields can be passed as a fixed value, runtime input, or an expression.
296+
297+
<details>
298+
<summary>Sample YAML</summary>
287299

288-
```YAML
300+
```yaml
289301
- step:
290302
type: TerraformApply
291303
name: Apply
@@ -305,6 +317,7 @@ When configured the optional configuration for AWS Connector these fields can be
305317
roleArn: <+input>
306318
timeout: 10m
307319
```
320+
</details>
308321
309322
#### Terraform variable files
310323
@@ -325,6 +338,49 @@ See [Artifactory Connector Settings Reference](/docs/platform/connectors/cloud-p
325338

326339
Click **Submit**. The remote file(s) are added.
327340

341+
### Azure Connector
342+
343+
Harness Terraform steps now support authenticating with Azure using Azure connectors for target provisioning. This enables seamless integration with Azure infrastructure when running Terraform Plan, Apply, and Destroy steps with inline Terraform configuration.
344+
345+
#### Key Features
346+
347+
- **Azure Connector support:** Authenticate Terraform operations using Azure connectors configured in Harness.
348+
- **Authentication methods:** Manual credentials, Delegate-based credentials, OIDC token-based authentication are supported. Certificate-based authentication is **not supported** yet.
349+
- **Additional options:** Default configuration can be overridden with environment variables like ARM_TENANT_ID and ARM_MSI_ENDPOINT for advanced scenarios.
350+
351+
For more information on how to setup an Azure connector, go to [Azure Connector Settings Reference](/docs/platform/connectors/cloud-providers/add-a-microsoft-azure-connector).
352+
353+
#### YAML Configuration Example
354+
355+
<details>
356+
<summary>Sample YAML</summary>
357+
358+
```yaml
359+
- step:
360+
type: TerraformPlan
361+
name: TerraformPlan_1
362+
identifier: TerraformPlan_1
363+
spec:
364+
provisionerIdentifier: planoidc
365+
configuration:
366+
command: Apply
367+
configFiles:
368+
store:
369+
spec:
370+
connectorRef: githubConnector
371+
repoName: play
372+
gitFetchType: Branch
373+
branch: main
374+
folderPath: tf/azure
375+
type: Github
376+
providerCredential:
377+
type: Azure
378+
spec:
379+
connectorRef: AzureConnector
380+
subscriptionId: 20xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
381+
```
382+
</details>
383+
328384
## Backend Configuration
329385

330386
The **Backend Configuration** section contains the [remote state](https://www.terraform.io/docs/language/state/remote.html) values.
34.9 KB
Loading

0 commit comments

Comments
 (0)