1. Packages
  2. Azure Classic
  3. API Docs
  4. automation
  5. ConnectionCertificate

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.automation.ConnectionCertificate

Explore with Pulumi AI

Manages an Automation Connection with type Azure.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as std from "@pulumi/std";

const exampleResourceGroup = new azure.core.ResourceGroup("example", {
    name: "resourceGroup-example",
    location: "West Europe",
});
const example = azure.core.getClientConfig({});
const exampleAccount = new azure.automation.Account("example", {
    name: "account-example",
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    skuName: "Basic",
});
const exampleCertificate = new azure.automation.Certificate("example", {
    name: "certificate-example",
    resourceGroupName: exampleResourceGroup.name,
    automationAccountName: exampleAccount.name,
    base64: std.filebase64({
        input: "certificate.pfx",
    }).then(invoke => invoke.result),
});
const exampleConnectionCertificate = new azure.automation.ConnectionCertificate("example", {
    name: "connection-example",
    resourceGroupName: exampleResourceGroup.name,
    automationAccountName: exampleAccount.name,
    automationCertificateName: exampleCertificate.name,
    subscriptionId: example.then(example => example.subscriptionId),
});
Copy
import pulumi
import pulumi_azure as azure
import pulumi_std as std

example_resource_group = azure.core.ResourceGroup("example",
    name="resourceGroup-example",
    location="West Europe")
example = azure.core.get_client_config()
example_account = azure.automation.Account("example",
    name="account-example",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku_name="Basic")
example_certificate = azure.automation.Certificate("example",
    name="certificate-example",
    resource_group_name=example_resource_group.name,
    automation_account_name=example_account.name,
    base64=std.filebase64(input="certificate.pfx").result)
example_connection_certificate = azure.automation.ConnectionCertificate("example",
    name="connection-example",
    resource_group_name=example_resource_group.name,
    automation_account_name=example_account.name,
    automation_certificate_name=example_certificate.name,
    subscription_id=example.subscription_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("resourceGroup-example"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		example, err := core.GetClientConfig(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
			Name:              pulumi.String("account-example"),
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			SkuName:           pulumi.String("Basic"),
		})
		if err != nil {
			return err
		}
		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
			Input: "certificate.pfx",
		}, nil)
		if err != nil {
			return err
		}
		exampleCertificate, err := automation.NewCertificate(ctx, "example", &automation.CertificateArgs{
			Name:                  pulumi.String("certificate-example"),
			ResourceGroupName:     exampleResourceGroup.Name,
			AutomationAccountName: exampleAccount.Name,
			Base64:                pulumi.String(invokeFilebase64.Result),
		})
		if err != nil {
			return err
		}
		_, err = automation.NewConnectionCertificate(ctx, "example", &automation.ConnectionCertificateArgs{
			Name:                      pulumi.String("connection-example"),
			ResourceGroupName:         exampleResourceGroup.Name,
			AutomationAccountName:     exampleAccount.Name,
			AutomationCertificateName: exampleCertificate.Name,
			SubscriptionId:            pulumi.String(example.SubscriptionId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "resourceGroup-example",
        Location = "West Europe",
    });

    var example = Azure.Core.GetClientConfig.Invoke();

    var exampleAccount = new Azure.Automation.Account("example", new()
    {
        Name = "account-example",
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        SkuName = "Basic",
    });

    var exampleCertificate = new Azure.Automation.Certificate("example", new()
    {
        Name = "certificate-example",
        ResourceGroupName = exampleResourceGroup.Name,
        AutomationAccountName = exampleAccount.Name,
        Base64 = Std.Filebase64.Invoke(new()
        {
            Input = "certificate.pfx",
        }).Apply(invoke => invoke.Result),
    });

    var exampleConnectionCertificate = new Azure.Automation.ConnectionCertificate("example", new()
    {
        Name = "connection-example",
        ResourceGroupName = exampleResourceGroup.Name,
        AutomationAccountName = exampleAccount.Name,
        AutomationCertificateName = exampleCertificate.Name,
        SubscriptionId = example.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.automation.Account;
import com.pulumi.azure.automation.AccountArgs;
import com.pulumi.azure.automation.Certificate;
import com.pulumi.azure.automation.CertificateArgs;
import com.pulumi.azure.automation.ConnectionCertificate;
import com.pulumi.azure.automation.ConnectionCertificateArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
            .name("resourceGroup-example")
            .location("West Europe")
            .build());

        final var example = CoreFunctions.getClientConfig();

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
            .name("account-example")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .skuName("Basic")
            .build());

        var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
            .name("certificate-example")
            .resourceGroupName(exampleResourceGroup.name())
            .automationAccountName(exampleAccount.name())
            .base64(StdFunctions.filebase64(Filebase64Args.builder()
                .input("certificate.pfx")
                .build()).result())
            .build());

        var exampleConnectionCertificate = new ConnectionCertificate("exampleConnectionCertificate", ConnectionCertificateArgs.builder()
            .name("connection-example")
            .resourceGroupName(exampleResourceGroup.name())
            .automationAccountName(exampleAccount.name())
            .automationCertificateName(exampleCertificate.name())
            .subscriptionId(example.applyValue(getClientConfigResult -> getClientConfigResult.subscriptionId()))
            .build());

    }
}
Copy
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    name: example
    properties:
      name: resourceGroup-example
      location: West Europe
  exampleAccount:
    type: azure:automation:Account
    name: example
    properties:
      name: account-example
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      skuName: Basic
  exampleCertificate:
    type: azure:automation:Certificate
    name: example
    properties:
      name: certificate-example
      resourceGroupName: ${exampleResourceGroup.name}
      automationAccountName: ${exampleAccount.name}
      base64:
        fn::invoke:
          function: std:filebase64
          arguments:
            input: certificate.pfx
          return: result
  exampleConnectionCertificate:
    type: azure:automation:ConnectionCertificate
    name: example
    properties:
      name: connection-example
      resourceGroupName: ${exampleResourceGroup.name}
      automationAccountName: ${exampleAccount.name}
      automationCertificateName: ${exampleCertificate.name}
      subscriptionId: ${example.subscriptionId}
variables:
  example:
    fn::invoke:
      function: azure:core:getClientConfig
      arguments: {}
Copy

Create ConnectionCertificate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ConnectionCertificate(name: string, args: ConnectionCertificateArgs, opts?: CustomResourceOptions);
@overload
def ConnectionCertificate(resource_name: str,
                          args: ConnectionCertificateArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def ConnectionCertificate(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          automation_account_name: Optional[str] = None,
                          automation_certificate_name: Optional[str] = None,
                          resource_group_name: Optional[str] = None,
                          subscription_id: Optional[str] = None,
                          description: Optional[str] = None,
                          name: Optional[str] = None)
func NewConnectionCertificate(ctx *Context, name string, args ConnectionCertificateArgs, opts ...ResourceOption) (*ConnectionCertificate, error)
public ConnectionCertificate(string name, ConnectionCertificateArgs args, CustomResourceOptions? opts = null)
public ConnectionCertificate(String name, ConnectionCertificateArgs args)
public ConnectionCertificate(String name, ConnectionCertificateArgs args, CustomResourceOptions options)
type: azure:automation:ConnectionCertificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ConnectionCertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ConnectionCertificateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ConnectionCertificateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ConnectionCertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ConnectionCertificateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var connectionCertificateResource = new Azure.Automation.ConnectionCertificate("connectionCertificateResource", new()
{
    AutomationAccountName = "string",
    AutomationCertificateName = "string",
    ResourceGroupName = "string",
    SubscriptionId = "string",
    Description = "string",
    Name = "string",
});
Copy
example, err := automation.NewConnectionCertificate(ctx, "connectionCertificateResource", &automation.ConnectionCertificateArgs{
	AutomationAccountName:     pulumi.String("string"),
	AutomationCertificateName: pulumi.String("string"),
	ResourceGroupName:         pulumi.String("string"),
	SubscriptionId:            pulumi.String("string"),
	Description:               pulumi.String("string"),
	Name:                      pulumi.String("string"),
})
Copy
var connectionCertificateResource = new ConnectionCertificate("connectionCertificateResource", ConnectionCertificateArgs.builder()
    .automationAccountName("string")
    .automationCertificateName("string")
    .resourceGroupName("string")
    .subscriptionId("string")
    .description("string")
    .name("string")
    .build());
Copy
connection_certificate_resource = azure.automation.ConnectionCertificate("connectionCertificateResource",
    automation_account_name="string",
    automation_certificate_name="string",
    resource_group_name="string",
    subscription_id="string",
    description="string",
    name="string")
Copy
const connectionCertificateResource = new azure.automation.ConnectionCertificate("connectionCertificateResource", {
    automationAccountName: "string",
    automationCertificateName: "string",
    resourceGroupName: "string",
    subscriptionId: "string",
    description: "string",
    name: "string",
});
Copy
type: azure:automation:ConnectionCertificate
properties:
    automationAccountName: string
    automationCertificateName: string
    description: string
    name: string
    resourceGroupName: string
    subscriptionId: string
Copy

ConnectionCertificate Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ConnectionCertificate resource accepts the following input properties:

AutomationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
AutomationCertificateName This property is required. string
The name of the automation certificate.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
SubscriptionId This property is required. string
The id of subscription where the automation certificate exists.
Description string
A description for this Connection.
Name Changes to this property will trigger replacement. string
Specifies the name of the Connection. Changing this forces a new resource to be created.
AutomationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
AutomationCertificateName This property is required. string
The name of the automation certificate.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
SubscriptionId This property is required. string
The id of subscription where the automation certificate exists.
Description string
A description for this Connection.
Name Changes to this property will trigger replacement. string
Specifies the name of the Connection. Changing this forces a new resource to be created.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automationCertificateName This property is required. String
The name of the automation certificate.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscriptionId This property is required. String
The id of subscription where the automation certificate exists.
description String
A description for this Connection.
name Changes to this property will trigger replacement. String
Specifies the name of the Connection. Changing this forces a new resource to be created.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
string
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automationCertificateName This property is required. string
The name of the automation certificate.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscriptionId This property is required. string
The id of subscription where the automation certificate exists.
description string
A description for this Connection.
name Changes to this property will trigger replacement. string
Specifies the name of the Connection. Changing this forces a new resource to be created.
automation_account_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automation_certificate_name This property is required. str
The name of the automation certificate.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscription_id This property is required. str
The id of subscription where the automation certificate exists.
description str
A description for this Connection.
name Changes to this property will trigger replacement. str
Specifies the name of the Connection. Changing this forces a new resource to be created.
automationAccountName
This property is required.
Changes to this property will trigger replacement.
String
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automationCertificateName This property is required. String
The name of the automation certificate.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscriptionId This property is required. String
The id of subscription where the automation certificate exists.
description String
A description for this Connection.
name Changes to this property will trigger replacement. String
Specifies the name of the Connection. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the ConnectionCertificate resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ConnectionCertificate Resource

Get an existing ConnectionCertificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ConnectionCertificateState, opts?: CustomResourceOptions): ConnectionCertificate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        automation_account_name: Optional[str] = None,
        automation_certificate_name: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        subscription_id: Optional[str] = None) -> ConnectionCertificate
func GetConnectionCertificate(ctx *Context, name string, id IDInput, state *ConnectionCertificateState, opts ...ResourceOption) (*ConnectionCertificate, error)
public static ConnectionCertificate Get(string name, Input<string> id, ConnectionCertificateState? state, CustomResourceOptions? opts = null)
public static ConnectionCertificate get(String name, Output<String> id, ConnectionCertificateState state, CustomResourceOptions options)
resources:  _:    type: azure:automation:ConnectionCertificate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AutomationAccountName Changes to this property will trigger replacement. string
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
AutomationCertificateName string
The name of the automation certificate.
Description string
A description for this Connection.
Name Changes to this property will trigger replacement. string
Specifies the name of the Connection. Changing this forces a new resource to be created.
ResourceGroupName Changes to this property will trigger replacement. string
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
SubscriptionId string
The id of subscription where the automation certificate exists.
AutomationAccountName Changes to this property will trigger replacement. string
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
AutomationCertificateName string
The name of the automation certificate.
Description string
A description for this Connection.
Name Changes to this property will trigger replacement. string
Specifies the name of the Connection. Changing this forces a new resource to be created.
ResourceGroupName Changes to this property will trigger replacement. string
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
SubscriptionId string
The id of subscription where the automation certificate exists.
automationAccountName Changes to this property will trigger replacement. String
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automationCertificateName String
The name of the automation certificate.
description String
A description for this Connection.
name Changes to this property will trigger replacement. String
Specifies the name of the Connection. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. String
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscriptionId String
The id of subscription where the automation certificate exists.
automationAccountName Changes to this property will trigger replacement. string
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automationCertificateName string
The name of the automation certificate.
description string
A description for this Connection.
name Changes to this property will trigger replacement. string
Specifies the name of the Connection. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. string
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscriptionId string
The id of subscription where the automation certificate exists.
automation_account_name Changes to this property will trigger replacement. str
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automation_certificate_name str
The name of the automation certificate.
description str
A description for this Connection.
name Changes to this property will trigger replacement. str
Specifies the name of the Connection. Changing this forces a new resource to be created.
resource_group_name Changes to this property will trigger replacement. str
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscription_id str
The id of subscription where the automation certificate exists.
automationAccountName Changes to this property will trigger replacement. String
The name of the automation account in which the Connection is created. Changing this forces a new resource to be created.
automationCertificateName String
The name of the automation certificate.
description String
A description for this Connection.
name Changes to this property will trigger replacement. String
Specifies the name of the Connection. Changing this forces a new resource to be created.
resourceGroupName Changes to this property will trigger replacement. String
The name of the resource group in which the Connection is created. Changing this forces a new resource to be created.
subscriptionId String
The id of subscription where the automation certificate exists.

Import

Automation Connection can be imported using the resource id, e.g.

$ pulumi import azure:automation/connectionCertificate:ConnectionCertificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/connections/conn1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.