We recommend using Azure Native.
azure.automation.Certificate
Explore with Pulumi AI
Manages an Automation Certificate.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as std from "@pulumi/std";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAccount = new azure.automation.Account("example", {
name: "account1",
location: example.location,
resourceGroupName: example.name,
skuName: "Basic",
});
const exampleCertificate = new azure.automation.Certificate("example", {
name: "certificate1",
resourceGroupName: example.name,
automationAccountName: exampleAccount.name,
description: "This is an example certificate",
base64: std.filebase64({
input: "certificate.pfx",
}).then(invoke => invoke.result),
exportable: true,
});
import pulumi
import pulumi_azure as azure
import pulumi_std as std
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.automation.Account("example",
name="account1",
location=example.location,
resource_group_name=example.name,
sku_name="Basic")
example_certificate = azure.automation.Certificate("example",
name="certificate1",
resource_group_name=example.name,
automation_account_name=example_account.name,
description="This is an example certificate",
base64=std.filebase64(input="certificate.pfx").result,
exportable=True)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
"github.com/pulumi/pulumi-azure/sdk/v5/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 {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
Name: pulumi.String("account1"),
Location: example.Location,
ResourceGroupName: example.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
}
_, err = automation.NewCertificate(ctx, "example", &automation.CertificateArgs{
Name: pulumi.String("certificate1"),
ResourceGroupName: example.Name,
AutomationAccountName: exampleAccount.Name,
Description: pulumi.String("This is an example certificate"),
Base64: invokeFilebase64.Result,
Exportable: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleAccount = new Azure.Automation.Account("example", new()
{
Name = "account1",
Location = example.Location,
ResourceGroupName = example.Name,
SkuName = "Basic",
});
var exampleCertificate = new Azure.Automation.Certificate("example", new()
{
Name = "certificate1",
ResourceGroupName = example.Name,
AutomationAccountName = exampleAccount.Name,
Description = "This is an example certificate",
Base64 = Std.Filebase64.Invoke(new()
{
Input = "certificate.pfx",
}).Apply(invoke => invoke.Result),
Exportable = true,
});
});
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.automation.Account;
import com.pulumi.azure.automation.AccountArgs;
import com.pulumi.azure.automation.Certificate;
import com.pulumi.azure.automation.CertificateArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("account1")
.location(example.location())
.resourceGroupName(example.name())
.skuName("Basic")
.build());
var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
.name("certificate1")
.resourceGroupName(example.name())
.automationAccountName(exampleAccount.name())
.description("This is an example certificate")
.base64(StdFunctions.filebase64(Filebase64Args.builder()
.input("certificate.pfx")
.build()).result())
.exportable(true)
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:automation:Account
name: example
properties:
name: account1
location: ${example.location}
resourceGroupName: ${example.name}
skuName: Basic
exampleCertificate:
type: azure:automation:Certificate
name: example
properties:
name: certificate1
resourceGroupName: ${example.name}
automationAccountName: ${exampleAccount.name}
description: This is an example certificate
base64:
fn::invoke:
Function: std:filebase64
Arguments:
input: certificate.pfx
Return: result
exportable: true
Create Certificate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
@overload
def Certificate(resource_name: str,
args: CertificateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Certificate(resource_name: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
base64: Optional[str] = None,
resource_group_name: Optional[str] = None,
description: Optional[str] = None,
exportable: Optional[bool] = None,
name: Optional[str] = None)
func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
public Certificate(String name, CertificateArgs args)
public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
type: azure:automation:Certificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CertificateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CertificateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CertificateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CertificateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CertificateArgs
- 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 examplecertificateResourceResourceFromAutomationcertificate = new Azure.Automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate", new()
{
AutomationAccountName = "string",
Base64 = "string",
ResourceGroupName = "string",
Description = "string",
Exportable = false,
Name = "string",
});
example, err := automation.NewCertificate(ctx, "examplecertificateResourceResourceFromAutomationcertificate", &automation.CertificateArgs{
AutomationAccountName: pulumi.String("string"),
Base64: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Description: pulumi.String("string"),
Exportable: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var examplecertificateResourceResourceFromAutomationcertificate = new Certificate("examplecertificateResourceResourceFromAutomationcertificate", CertificateArgs.builder()
.automationAccountName("string")
.base64("string")
.resourceGroupName("string")
.description("string")
.exportable(false)
.name("string")
.build());
examplecertificate_resource_resource_from_automationcertificate = azure.automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate",
automation_account_name="string",
base64="string",
resource_group_name="string",
description="string",
exportable=False,
name="string")
const examplecertificateResourceResourceFromAutomationcertificate = new azure.automation.Certificate("examplecertificateResourceResourceFromAutomationcertificate", {
automationAccountName: "string",
base64: "string",
resourceGroupName: "string",
description: "string",
exportable: false,
name: "string",
});
type: azure:automation:Certificate
properties:
automationAccountName: string
base64: string
description: string
exportable: false
name: string
resourceGroupName: string
Certificate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Certificate resource accepts the following input properties:
- Automation
Account stringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- Base64 string
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- Description string
- The description of this Automation Certificate.
- Exportable bool
- The is exportable flag of the certificate.
- Name string
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- Automation
Account stringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- Base64 string
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- Description string
- The description of this Automation Certificate.
- Exportable bool
- The is exportable flag of the certificate.
- Name string
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- automation
Account StringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 String
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- description String
- The description of this Automation Certificate.
- exportable Boolean
- The is exportable flag of the certificate.
- name String
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- automation
Account stringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 string
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- description string
- The description of this Automation Certificate.
- exportable boolean
- The is exportable flag of the certificate.
- name string
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- automation_
account_ strname - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 str
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- description str
- The description of this Automation Certificate.
- exportable bool
- The is exportable flag of the certificate.
- name str
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- automation
Account StringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 String
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- description String
- The description of this Automation Certificate.
- exportable Boolean
- The is exportable flag of the certificate.
- name String
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Certificate resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Thumbprint string
- The thumbprint for the certificate.
- Id string
- The provider-assigned unique ID for this managed resource.
- Thumbprint string
- The thumbprint for the certificate.
- id String
- The provider-assigned unique ID for this managed resource.
- thumbprint String
- The thumbprint for the certificate.
- id string
- The provider-assigned unique ID for this managed resource.
- thumbprint string
- The thumbprint for the certificate.
- id str
- The provider-assigned unique ID for this managed resource.
- thumbprint str
- The thumbprint for the certificate.
- id String
- The provider-assigned unique ID for this managed resource.
- thumbprint String
- The thumbprint for the certificate.
Look up Existing Certificate Resource
Get an existing Certificate 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?: CertificateState, opts?: CustomResourceOptions): Certificate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
base64: Optional[str] = None,
description: Optional[str] = None,
exportable: Optional[bool] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
thumbprint: Optional[str] = None) -> Certificate
func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Automation
Account stringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- Base64 string
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- Description string
- The description of this Automation Certificate.
- Exportable bool
- The is exportable flag of the certificate.
- Name string
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- Thumbprint string
- The thumbprint for the certificate.
- Automation
Account stringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- Base64 string
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- Description string
- The description of this Automation Certificate.
- Exportable bool
- The is exportable flag of the certificate.
- Name string
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- Thumbprint string
- The thumbprint for the certificate.
- automation
Account StringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 String
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- description String
- The description of this Automation Certificate.
- exportable Boolean
- The is exportable flag of the certificate.
- name String
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- thumbprint String
- The thumbprint for the certificate.
- automation
Account stringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 string
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- description string
- The description of this Automation Certificate.
- exportable boolean
- The is exportable flag of the certificate.
- name string
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- thumbprint string
- The thumbprint for the certificate.
- automation_
account_ strname - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 str
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- description str
- The description of this Automation Certificate.
- exportable bool
- The is exportable flag of the certificate.
- name str
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- thumbprint str
- The thumbprint for the certificate.
- automation
Account StringName - The name of the automation account in which the Certificate is created. Changing this forces a new resource to be created.
- base64 String
- Base64 encoded value of the certificate. Changing this forces a new resource to be created.
- description String
- The description of this Automation Certificate.
- exportable Boolean
- The is exportable flag of the certificate.
- name String
- Specifies the name of the Certificate. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which the Certificate is created. Changing this forces a new resource to be created.
- thumbprint String
- The thumbprint for the certificate.
Import
Automation Certificates can be imported using the resource id
, e.g.
$ pulumi import azure:automation/certificate:Certificate certificate1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/certificates/certificate1
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.