1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. AccessCaCertificate
Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi

cloudflare.AccessCaCertificate

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi

    Cloudflare Access can replace traditional SSH key models with short-lived certificates issued to your users based on the token generated by their Access login.

    It’s required that an account_id or zone_id is provided and in most cases using either is fine. However, if you’re using a scoped access token, you must provide the argument that matches the token’s scope. For example, an access token that is scoped to the “example.com” zone needs to use the zone_id argument.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    // account level
    const example = new cloudflare.AccessCaCertificate("example", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        applicationId: "6cd6cea3-3ef2-4542-9aea-85a0bbcd5414",
    });
    // zone level
    const anotherExample = new cloudflare.AccessCaCertificate("another_example", {
        zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
        applicationId: "fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    # account level
    example = cloudflare.AccessCaCertificate("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        application_id="6cd6cea3-3ef2-4542-9aea-85a0bbcd5414")
    # zone level
    another_example = cloudflare.AccessCaCertificate("another_example",
        zone_id="0da42c8d2132a9ddaf714f9e7c920711",
        application_id="fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// account level
    		_, err := cloudflare.NewAccessCaCertificate(ctx, "example", &cloudflare.AccessCaCertificateArgs{
    			AccountId:     pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ApplicationId: pulumi.String("6cd6cea3-3ef2-4542-9aea-85a0bbcd5414"),
    		})
    		if err != nil {
    			return err
    		}
    		// zone level
    		_, err = cloudflare.NewAccessCaCertificate(ctx, "another_example", &cloudflare.AccessCaCertificateArgs{
    			ZoneId:        pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
    			ApplicationId: pulumi.String("fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        // account level
        var example = new Cloudflare.AccessCaCertificate("example", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            ApplicationId = "6cd6cea3-3ef2-4542-9aea-85a0bbcd5414",
        });
    
        // zone level
        var anotherExample = new Cloudflare.AccessCaCertificate("another_example", new()
        {
            ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
            ApplicationId = "fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.AccessCaCertificate;
    import com.pulumi.cloudflare.AccessCaCertificateArgs;
    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) {
            // account level
            var example = new AccessCaCertificate("example", AccessCaCertificateArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .applicationId("6cd6cea3-3ef2-4542-9aea-85a0bbcd5414")
                .build());
    
            // zone level
            var anotherExample = new AccessCaCertificate("anotherExample", AccessCaCertificateArgs.builder()
                .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
                .applicationId("fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2")
                .build());
    
        }
    }
    
    resources:
      # account level
      example:
        type: cloudflare:AccessCaCertificate
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          applicationId: 6cd6cea3-3ef2-4542-9aea-85a0bbcd5414
      # zone level
      anotherExample:
        type: cloudflare:AccessCaCertificate
        name: another_example
        properties:
          zoneId: 0da42c8d2132a9ddaf714f9e7c920711
          applicationId: fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2
    

    Create AccessCaCertificate Resource

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

    Constructor syntax

    new AccessCaCertificate(name: string, args: AccessCaCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def AccessCaCertificate(resource_name: str,
                            args: AccessCaCertificateArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccessCaCertificate(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            application_id: Optional[str] = None,
                            account_id: Optional[str] = None,
                            zone_id: Optional[str] = None)
    func NewAccessCaCertificate(ctx *Context, name string, args AccessCaCertificateArgs, opts ...ResourceOption) (*AccessCaCertificate, error)
    public AccessCaCertificate(string name, AccessCaCertificateArgs args, CustomResourceOptions? opts = null)
    public AccessCaCertificate(String name, AccessCaCertificateArgs args)
    public AccessCaCertificate(String name, AccessCaCertificateArgs args, CustomResourceOptions options)
    
    type: cloudflare:AccessCaCertificate
    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 AccessCaCertificateArgs
    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 AccessCaCertificateArgs
    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 AccessCaCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccessCaCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccessCaCertificateArgs
    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 accessCaCertificateResource = new Cloudflare.AccessCaCertificate("accessCaCertificateResource", new()
    {
        ApplicationId = "string",
        AccountId = "string",
        ZoneId = "string",
    });
    
    example, err := cloudflare.NewAccessCaCertificate(ctx, "accessCaCertificateResource", &cloudflare.AccessCaCertificateArgs{
    	ApplicationId: pulumi.String("string"),
    	AccountId:     pulumi.String("string"),
    	ZoneId:        pulumi.String("string"),
    })
    
    var accessCaCertificateResource = new AccessCaCertificate("accessCaCertificateResource", AccessCaCertificateArgs.builder()
        .applicationId("string")
        .accountId("string")
        .zoneId("string")
        .build());
    
    access_ca_certificate_resource = cloudflare.AccessCaCertificate("accessCaCertificateResource",
        application_id="string",
        account_id="string",
        zone_id="string")
    
    const accessCaCertificateResource = new cloudflare.AccessCaCertificate("accessCaCertificateResource", {
        applicationId: "string",
        accountId: "string",
        zoneId: "string",
    });
    
    type: cloudflare:AccessCaCertificate
    properties:
        accountId: string
        applicationId: string
        zoneId: string
    

    AccessCaCertificate 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 AccessCaCertificate resource accepts the following input properties:

    ApplicationId string
    The Access Application ID to associate with the CA certificate.
    AccountId string
    The account identifier to target for the resource. Conflicts with zone_id.
    ZoneId string
    The zone identifier to target for the resource. Conflicts with account_id.
    ApplicationId string
    The Access Application ID to associate with the CA certificate.
    AccountId string
    The account identifier to target for the resource. Conflicts with zone_id.
    ZoneId string
    The zone identifier to target for the resource. Conflicts with account_id.
    applicationId String
    The Access Application ID to associate with the CA certificate.
    accountId String
    The account identifier to target for the resource. Conflicts with zone_id.
    zoneId String
    The zone identifier to target for the resource. Conflicts with account_id.
    applicationId string
    The Access Application ID to associate with the CA certificate.
    accountId string
    The account identifier to target for the resource. Conflicts with zone_id.
    zoneId string
    The zone identifier to target for the resource. Conflicts with account_id.
    application_id str
    The Access Application ID to associate with the CA certificate.
    account_id str
    The account identifier to target for the resource. Conflicts with zone_id.
    zone_id str
    The zone identifier to target for the resource. Conflicts with account_id.
    applicationId String
    The Access Application ID to associate with the CA certificate.
    accountId String
    The account identifier to target for the resource. Conflicts with zone_id.
    zoneId String
    The zone identifier to target for the resource. Conflicts with account_id.

    Outputs

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

    Aud string
    Application Audience (AUD) Tag of the CA certificate.
    Id string
    The provider-assigned unique ID for this managed resource.
    PublicKey string
    Cryptographic public key of the generated CA certificate.
    Aud string
    Application Audience (AUD) Tag of the CA certificate.
    Id string
    The provider-assigned unique ID for this managed resource.
    PublicKey string
    Cryptographic public key of the generated CA certificate.
    aud String
    Application Audience (AUD) Tag of the CA certificate.
    id String
    The provider-assigned unique ID for this managed resource.
    publicKey String
    Cryptographic public key of the generated CA certificate.
    aud string
    Application Audience (AUD) Tag of the CA certificate.
    id string
    The provider-assigned unique ID for this managed resource.
    publicKey string
    Cryptographic public key of the generated CA certificate.
    aud str
    Application Audience (AUD) Tag of the CA certificate.
    id str
    The provider-assigned unique ID for this managed resource.
    public_key str
    Cryptographic public key of the generated CA certificate.
    aud String
    Application Audience (AUD) Tag of the CA certificate.
    id String
    The provider-assigned unique ID for this managed resource.
    publicKey String
    Cryptographic public key of the generated CA certificate.

    Look up Existing AccessCaCertificate Resource

    Get an existing AccessCaCertificate 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?: AccessCaCertificateState, opts?: CustomResourceOptions): AccessCaCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            application_id: Optional[str] = None,
            aud: Optional[str] = None,
            public_key: Optional[str] = None,
            zone_id: Optional[str] = None) -> AccessCaCertificate
    func GetAccessCaCertificate(ctx *Context, name string, id IDInput, state *AccessCaCertificateState, opts ...ResourceOption) (*AccessCaCertificate, error)
    public static AccessCaCertificate Get(string name, Input<string> id, AccessCaCertificateState? state, CustomResourceOptions? opts = null)
    public static AccessCaCertificate get(String name, Output<String> id, AccessCaCertificateState 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.
    The following state arguments are supported:
    AccountId string
    The account identifier to target for the resource. Conflicts with zone_id.
    ApplicationId string
    The Access Application ID to associate with the CA certificate.
    Aud string
    Application Audience (AUD) Tag of the CA certificate.
    PublicKey string
    Cryptographic public key of the generated CA certificate.
    ZoneId string
    The zone identifier to target for the resource. Conflicts with account_id.
    AccountId string
    The account identifier to target for the resource. Conflicts with zone_id.
    ApplicationId string
    The Access Application ID to associate with the CA certificate.
    Aud string
    Application Audience (AUD) Tag of the CA certificate.
    PublicKey string
    Cryptographic public key of the generated CA certificate.
    ZoneId string
    The zone identifier to target for the resource. Conflicts with account_id.
    accountId String
    The account identifier to target for the resource. Conflicts with zone_id.
    applicationId String
    The Access Application ID to associate with the CA certificate.
    aud String
    Application Audience (AUD) Tag of the CA certificate.
    publicKey String
    Cryptographic public key of the generated CA certificate.
    zoneId String
    The zone identifier to target for the resource. Conflicts with account_id.
    accountId string
    The account identifier to target for the resource. Conflicts with zone_id.
    applicationId string
    The Access Application ID to associate with the CA certificate.
    aud string
    Application Audience (AUD) Tag of the CA certificate.
    publicKey string
    Cryptographic public key of the generated CA certificate.
    zoneId string
    The zone identifier to target for the resource. Conflicts with account_id.
    account_id str
    The account identifier to target for the resource. Conflicts with zone_id.
    application_id str
    The Access Application ID to associate with the CA certificate.
    aud str
    Application Audience (AUD) Tag of the CA certificate.
    public_key str
    Cryptographic public key of the generated CA certificate.
    zone_id str
    The zone identifier to target for the resource. Conflicts with account_id.
    accountId String
    The account identifier to target for the resource. Conflicts with zone_id.
    applicationId String
    The Access Application ID to associate with the CA certificate.
    aud String
    Application Audience (AUD) Tag of the CA certificate.
    publicKey String
    Cryptographic public key of the generated CA certificate.
    zoneId String
    The zone identifier to target for the resource. Conflicts with account_id.

    Import

    Account level CA certificate import.

    $ pulumi import cloudflare:index/accessCaCertificate:AccessCaCertificate example account/<account_id>/<application_id>
    

    Zone level CA certificate import.

    $ pulumi import cloudflare:index/accessCaCertificate:AccessCaCertificate example account/<zone_id>/<application_id>
    

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

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi