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

com.pulumi.aws.pinpoint.kotlin.ApnsSandboxChannel.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.pinpoint.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [ApnsSandboxChannel].
 */
@PulumiTagMarker
public class ApnsSandboxChannelResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ApnsSandboxChannelArgs = ApnsSandboxChannelArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ApnsSandboxChannelArgsBuilder.() -> Unit) {
        val builder = ApnsSandboxChannelArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ApnsSandboxChannel {
        val builtJavaResource = com.pulumi.aws.pinpoint.ApnsSandboxChannel(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ApnsSandboxChannel(builtJavaResource)
    }
}

/**
 * Provides a Pinpoint APNs Sandbox Channel resource.
 * > **Note:** All arguments, including certificates and tokens, will be stored in the raw state as plain-text.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * import * as std from "@pulumi/std";
 * const app = new aws.pinpoint.App("app", {});
 * const apnsSandbox = new aws.pinpoint.ApnsSandboxChannel("apns_sandbox", {
 *     applicationId: app.applicationId,
 *     certificate: std.file({
 *         input: "./certificate.pem",
 *     }).then(invoke => invoke.result),
 *     privateKey: std.file({
 *         input: "./private_key.key",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * import pulumi_std as std
 * app = aws.pinpoint.App("app")
 * apns_sandbox = aws.pinpoint.ApnsSandboxChannel("apns_sandbox",
 *     application_id=app.application_id,
 *     certificate=std.file(input="./certificate.pem").result,
 *     private_key=std.file(input="./private_key.key").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var app = new Aws.Pinpoint.App("app");
 *     var apnsSandbox = new Aws.Pinpoint.ApnsSandboxChannel("apns_sandbox", new()
 *     {
 *         ApplicationId = app.ApplicationId,
 *         Certificate = Std.File.Invoke(new()
 *         {
 *             Input = "./certificate.pem",
 *         }).Apply(invoke => invoke.Result),
 *         PrivateKey = Std.File.Invoke(new()
 *         {
 *             Input = "./private_key.key",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pinpoint"
 * 	"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 {
 * 		app, err := pinpoint.NewApp(ctx, "app", nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "./certificate.pem",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile1, err := std.File(ctx, &std.FileArgs{
 * 			Input: "./private_key.key",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pinpoint.NewApnsSandboxChannel(ctx, "apns_sandbox", &pinpoint.ApnsSandboxChannelArgs{
 * 			ApplicationId: app.ApplicationId,
 * 			Certificate:   pulumi.String(invokeFile.Result),
 * 			PrivateKey:    pulumi.String(invokeFile1.Result),
 * 		})
 * 		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.aws.pinpoint.App;
 * import com.pulumi.aws.pinpoint.ApnsSandboxChannel;
 * import com.pulumi.aws.pinpoint.ApnsSandboxChannelArgs;
 * 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 app = new App("app");
 *         var apnsSandbox = new ApnsSandboxChannel("apnsSandbox", ApnsSandboxChannelArgs.builder()
 *             .applicationId(app.applicationId())
 *             .certificate(StdFunctions.file(FileArgs.builder()
 *                 .input("./certificate.pem")
 *                 .build()).result())
 *             .privateKey(StdFunctions.file(FileArgs.builder()
 *                 .input("./private_key.key")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   apnsSandbox:
 *     type: aws:pinpoint:ApnsSandboxChannel
 *     name: apns_sandbox
 *     properties:
 *       applicationId: ${app.applicationId}
 *       certificate:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: ./certificate.pem
 *           Return: result
 *       privateKey:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: ./private_key.key
 *           Return: result
 *   app:
 *     type: aws:pinpoint:App
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Pinpoint APNs Sandbox Channel using the `application-id`. For example:
 * ```sh
 * $ pulumi import aws:pinpoint/apnsSandboxChannel:ApnsSandboxChannel apns_sandbox application-id
 * ```
 */
public class ApnsSandboxChannel internal constructor(
    override val javaResource: com.pulumi.aws.pinpoint.ApnsSandboxChannel,
) : KotlinCustomResource(javaResource, ApnsSandboxChannelMapper) {
    /**
     * The application ID.
     */
    public val applicationId: Output
        get() = javaResource.applicationId().applyValue({ args0 -> args0 })

    /**
     * The ID assigned to your iOS app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and choose your app.
     */
    public val bundleId: Output?
        get() = javaResource.bundleId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The pem encoded TLS Certificate from Apple.
     */
    public val certificate: Output?
        get() = javaResource.certificate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The default authentication method used for APNs Sandbox.
     * __NOTE__: Amazon Pinpoint uses this default for every APNs push notification that you send using the console.
     * You can override the default when you send a message programmatically using the Amazon Pinpoint API, the AWS CLI, or an AWS SDK.
     * If your default authentication type fails, Amazon Pinpoint doesn't attempt to use the other authentication type.
     * One of the following sets of credentials is also required.
     * If you choose to use __Certificate credentials__ you will have to provide:
     */
    public val defaultAuthenticationMethod: Output?
        get() = javaResource.defaultAuthenticationMethod().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Whether the channel is enabled or disabled. Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Certificate Private Key file (ie. `.key` file).
     * If you choose to use __Key credentials__ you will have to provide:
     */
    public val privateKey: Output?
        get() = javaResource.privateKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID assigned to your Apple developer account team. This value is provided on the Membership page.
     */
    public val teamId: Output?
        get() = javaResource.teamId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The `.p8` file that you download from your Apple developer account when you create an authentication key.
     */
    public val tokenKey: Output?
        get() = javaResource.tokenKey().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section.
     */
    public val tokenKeyId: Output?
        get() = javaResource.tokenKeyId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object ApnsSandboxChannelMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.pinpoint.ApnsSandboxChannel::class == javaResource::class

    override fun map(javaResource: Resource): ApnsSandboxChannel = ApnsSandboxChannel(
        javaResource as
            com.pulumi.aws.pinpoint.ApnsSandboxChannel,
    )
}

/**
 * @see [ApnsSandboxChannel].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ApnsSandboxChannel].
 */
public suspend fun apnsSandboxChannel(
    name: String,
    block: suspend ApnsSandboxChannelResourceBuilder.() -> Unit,
): ApnsSandboxChannel {
    val builder = ApnsSandboxChannelResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ApnsSandboxChannel].
 * @param name The _unique_ name of the resulting resource.
 */
public fun apnsSandboxChannel(name: String): ApnsSandboxChannel {
    val builder = ApnsSandboxChannelResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy