All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.cloudflare.kotlin.AuthenticatedOriginPullsArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.AuthenticatedOriginPullsArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Provides a Cloudflare Authenticated Origin Pulls resource. A `cloudflare.AuthenticatedOriginPulls`
 * resource is required to use Per-Zone or Per-Hostname Authenticated
 * Origin Pulls.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * // Authenticated Origin Pulls
 * const myAop = new cloudflare.AuthenticatedOriginPulls("my_aop", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     enabled: true,
 * });
 * // Per-Zone Authenticated Origin Pulls
 * const myPerZoneAopCert = new cloudflare.AuthenticatedOriginPullsCertificate("my_per_zone_aop_cert", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     certificate: "-----INSERT CERTIFICATE-----",
 *     privateKey: "-----INSERT PRIVATE KEY-----",
 *     type: "per-zone",
 * });
 * const myPerZoneAop = new cloudflare.AuthenticatedOriginPulls("my_per_zone_aop", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     authenticatedOriginPullsCertificate: myPerZoneAopCert.id,
 *     enabled: true,
 * });
 * // Per-Hostname Authenticated Origin Pulls
 * const myPerHostnameAopCert = new cloudflare.AuthenticatedOriginPullsCertificate("my_per_hostname_aop_cert", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     certificate: "-----INSERT CERTIFICATE-----",
 *     privateKey: "-----INSERT PRIVATE KEY-----",
 *     type: "per-hostname",
 * });
 * const myPerHostnameAop = new cloudflare.AuthenticatedOriginPulls("my_per_hostname_aop", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     authenticatedOriginPullsCertificate: myPerHostnameAopCert.id,
 *     hostname: "aop.example.com",
 *     enabled: true,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * # Authenticated Origin Pulls
 * my_aop = cloudflare.AuthenticatedOriginPulls("my_aop",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     enabled=True)
 * # Per-Zone Authenticated Origin Pulls
 * my_per_zone_aop_cert = cloudflare.AuthenticatedOriginPullsCertificate("my_per_zone_aop_cert",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     certificate="-----INSERT CERTIFICATE-----",
 *     private_key="-----INSERT PRIVATE KEY-----",
 *     type="per-zone")
 * my_per_zone_aop = cloudflare.AuthenticatedOriginPulls("my_per_zone_aop",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     authenticated_origin_pulls_certificate=my_per_zone_aop_cert.id,
 *     enabled=True)
 * # Per-Hostname Authenticated Origin Pulls
 * my_per_hostname_aop_cert = cloudflare.AuthenticatedOriginPullsCertificate("my_per_hostname_aop_cert",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     certificate="-----INSERT CERTIFICATE-----",
 *     private_key="-----INSERT PRIVATE KEY-----",
 *     type="per-hostname")
 * my_per_hostname_aop = cloudflare.AuthenticatedOriginPulls("my_per_hostname_aop",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     authenticated_origin_pulls_certificate=my_per_hostname_aop_cert.id,
 *     hostname="aop.example.com",
 *     enabled=True)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     // Authenticated Origin Pulls
 *     var myAop = new Cloudflare.AuthenticatedOriginPulls("my_aop", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Enabled = true,
 *     });
 *     // Per-Zone Authenticated Origin Pulls
 *     var myPerZoneAopCert = new Cloudflare.AuthenticatedOriginPullsCertificate("my_per_zone_aop_cert", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Certificate = "-----INSERT CERTIFICATE-----",
 *         PrivateKey = "-----INSERT PRIVATE KEY-----",
 *         Type = "per-zone",
 *     });
 *     var myPerZoneAop = new Cloudflare.AuthenticatedOriginPulls("my_per_zone_aop", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         AuthenticatedOriginPullsCertificate = myPerZoneAopCert.Id,
 *         Enabled = true,
 *     });
 *     // Per-Hostname Authenticated Origin Pulls
 *     var myPerHostnameAopCert = new Cloudflare.AuthenticatedOriginPullsCertificate("my_per_hostname_aop_cert", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Certificate = "-----INSERT CERTIFICATE-----",
 *         PrivateKey = "-----INSERT PRIVATE KEY-----",
 *         Type = "per-hostname",
 *     });
 *     var myPerHostnameAop = new Cloudflare.AuthenticatedOriginPulls("my_per_hostname_aop", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         AuthenticatedOriginPullsCertificate = myPerHostnameAopCert.Id,
 *         Hostname = "aop.example.com",
 *         Enabled = true,
 *     });
 * });
 * ```
 * ```go
 * 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 {
 * 		// Authenticated Origin Pulls
 * 		_, err := cloudflare.NewAuthenticatedOriginPulls(ctx, "my_aop", &cloudflare.AuthenticatedOriginPullsArgs{
 * 			ZoneId:  pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Enabled: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// Per-Zone Authenticated Origin Pulls
 * 		myPerZoneAopCert, err := cloudflare.NewAuthenticatedOriginPullsCertificate(ctx, "my_per_zone_aop_cert", &cloudflare.AuthenticatedOriginPullsCertificateArgs{
 * 			ZoneId:      pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Certificate: pulumi.String("-----INSERT CERTIFICATE-----"),
 * 			PrivateKey:  pulumi.String("-----INSERT PRIVATE KEY-----"),
 * 			Type:        pulumi.String("per-zone"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = cloudflare.NewAuthenticatedOriginPulls(ctx, "my_per_zone_aop", &cloudflare.AuthenticatedOriginPullsArgs{
 * 			ZoneId:                              pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			AuthenticatedOriginPullsCertificate: myPerZoneAopCert.ID(),
 * 			Enabled:                             pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// Per-Hostname Authenticated Origin Pulls
 * 		myPerHostnameAopCert, err := cloudflare.NewAuthenticatedOriginPullsCertificate(ctx, "my_per_hostname_aop_cert", &cloudflare.AuthenticatedOriginPullsCertificateArgs{
 * 			ZoneId:      pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Certificate: pulumi.String("-----INSERT CERTIFICATE-----"),
 * 			PrivateKey:  pulumi.String("-----INSERT PRIVATE KEY-----"),
 * 			Type:        pulumi.String("per-hostname"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = cloudflare.NewAuthenticatedOriginPulls(ctx, "my_per_hostname_aop", &cloudflare.AuthenticatedOriginPullsArgs{
 * 			ZoneId:                              pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			AuthenticatedOriginPullsCertificate: myPerHostnameAopCert.ID(),
 * 			Hostname:                            pulumi.String("aop.example.com"),
 * 			Enabled:                             pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.cloudflare.AuthenticatedOriginPulls;
 * import com.pulumi.cloudflare.AuthenticatedOriginPullsArgs;
 * import com.pulumi.cloudflare.AuthenticatedOriginPullsCertificate;
 * import com.pulumi.cloudflare.AuthenticatedOriginPullsCertificateArgs;
 * 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) {
 *         // Authenticated Origin Pulls
 *         var myAop = new AuthenticatedOriginPulls("myAop", AuthenticatedOriginPullsArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .enabled(true)
 *             .build());
 *         // Per-Zone Authenticated Origin Pulls
 *         var myPerZoneAopCert = new AuthenticatedOriginPullsCertificate("myPerZoneAopCert", AuthenticatedOriginPullsCertificateArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .certificate("-----INSERT CERTIFICATE-----")
 *             .privateKey("-----INSERT PRIVATE KEY-----")
 *             .type("per-zone")
 *             .build());
 *         var myPerZoneAop = new AuthenticatedOriginPulls("myPerZoneAop", AuthenticatedOriginPullsArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .authenticatedOriginPullsCertificate(myPerZoneAopCert.id())
 *             .enabled(true)
 *             .build());
 *         // Per-Hostname Authenticated Origin Pulls
 *         var myPerHostnameAopCert = new AuthenticatedOriginPullsCertificate("myPerHostnameAopCert", AuthenticatedOriginPullsCertificateArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .certificate("-----INSERT CERTIFICATE-----")
 *             .privateKey("-----INSERT PRIVATE KEY-----")
 *             .type("per-hostname")
 *             .build());
 *         var myPerHostnameAop = new AuthenticatedOriginPulls("myPerHostnameAop", AuthenticatedOriginPullsArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .authenticatedOriginPullsCertificate(myPerHostnameAopCert.id())
 *             .hostname("aop.example.com")
 *             .enabled(true)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   # Authenticated Origin Pulls
 *   myAop:
 *     type: cloudflare:AuthenticatedOriginPulls
 *     name: my_aop
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       enabled: true
 *   # Per-Zone Authenticated Origin Pulls
 *   myPerZoneAopCert:
 *     type: cloudflare:AuthenticatedOriginPullsCertificate
 *     name: my_per_zone_aop_cert
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       certificate: '-----INSERT CERTIFICATE-----'
 *       privateKey: '-----INSERT PRIVATE KEY-----'
 *       type: per-zone
 *   myPerZoneAop:
 *     type: cloudflare:AuthenticatedOriginPulls
 *     name: my_per_zone_aop
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       authenticatedOriginPullsCertificate: ${myPerZoneAopCert.id}
 *       enabled: true
 *   # Per-Hostname Authenticated Origin Pulls
 *   myPerHostnameAopCert:
 *     type: cloudflare:AuthenticatedOriginPullsCertificate
 *     name: my_per_hostname_aop_cert
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       certificate: '-----INSERT CERTIFICATE-----'
 *       privateKey: '-----INSERT PRIVATE KEY-----'
 *       type: per-hostname
 *   myPerHostnameAop:
 *     type: cloudflare:AuthenticatedOriginPulls
 *     name: my_per_hostname_aop
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       authenticatedOriginPullsCertificate: ${myPerHostnameAopCert.id}
 *       hostname: aop.example.com
 *       enabled: true
 * ```
 * 
 * ## Import
 * global
 * ```sh
 * $ pulumi import cloudflare:index/authenticatedOriginPulls:AuthenticatedOriginPulls example 
 * ```
 * per zone
 * ```sh
 * $ pulumi import cloudflare:index/authenticatedOriginPulls:AuthenticatedOriginPulls example /
 * ```
 * per hostname
 * ```sh
 * $ pulumi import cloudflare:index/authenticatedOriginPulls:AuthenticatedOriginPulls example //
 * ```
 * @property authenticatedOriginPullsCertificate The ID of an uploaded Authenticated Origin Pulls certificate. If no hostname is provided, this certificate will be used zone wide as Per-Zone Authenticated Origin Pulls.
 * @property enabled Whether to enable Authenticated Origin Pulls on the given zone or hostname.
 * @property hostname Specify a hostname to enable Per-Hostname Authenticated Origin Pulls on, using the provided certificate.
 * @property zoneId The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
 */
public data class AuthenticatedOriginPullsArgs(
    public val authenticatedOriginPullsCertificate: Output? = null,
    public val enabled: Output? = null,
    public val hostname: Output? = null,
    public val zoneId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.AuthenticatedOriginPullsArgs =
        com.pulumi.cloudflare.AuthenticatedOriginPullsArgs.builder()
            .authenticatedOriginPullsCertificate(
                authenticatedOriginPullsCertificate?.applyValue({ args0 ->
                    args0
                }),
            )
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .hostname(hostname?.applyValue({ args0 -> args0 }))
            .zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AuthenticatedOriginPullsArgs].
 */
@PulumiTagMarker
public class AuthenticatedOriginPullsArgsBuilder internal constructor() {
    private var authenticatedOriginPullsCertificate: Output? = null

    private var enabled: Output? = null

    private var hostname: Output? = null

    private var zoneId: Output? = null

    /**
     * @param value The ID of an uploaded Authenticated Origin Pulls certificate. If no hostname is provided, this certificate will be used zone wide as Per-Zone Authenticated Origin Pulls.
     */
    @JvmName("pimvdexgnwissdbt")
    public suspend fun authenticatedOriginPullsCertificate(`value`: Output) {
        this.authenticatedOriginPullsCertificate = value
    }

    /**
     * @param value Whether to enable Authenticated Origin Pulls on the given zone or hostname.
     */
    @JvmName("qrtipnpvdogriikj")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value Specify a hostname to enable Per-Hostname Authenticated Origin Pulls on, using the provided certificate.
     */
    @JvmName("flnpvdugkxiotcqf")
    public suspend fun hostname(`value`: Output) {
        this.hostname = value
    }

    /**
     * @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("fswwykqgrqlftmky")
    public suspend fun zoneId(`value`: Output) {
        this.zoneId = value
    }

    /**
     * @param value The ID of an uploaded Authenticated Origin Pulls certificate. If no hostname is provided, this certificate will be used zone wide as Per-Zone Authenticated Origin Pulls.
     */
    @JvmName("ffrcihhvfoposuub")
    public suspend fun authenticatedOriginPullsCertificate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authenticatedOriginPullsCertificate = mapped
    }

    /**
     * @param value Whether to enable Authenticated Origin Pulls on the given zone or hostname.
     */
    @JvmName("voehjmwvbyrqlpcv")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value Specify a hostname to enable Per-Hostname Authenticated Origin Pulls on, using the provided certificate.
     */
    @JvmName("awygxmqtmwldsmrs")
    public suspend fun hostname(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostname = mapped
    }

    /**
     * @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("yeyxvaiachcqukxr")
    public suspend fun zoneId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneId = mapped
    }

    internal fun build(): AuthenticatedOriginPullsArgs = AuthenticatedOriginPullsArgs(
        authenticatedOriginPullsCertificate = authenticatedOriginPullsCertificate,
        enabled = enabled,
        hostname = hostname,
        zoneId = zoneId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy