com.pulumi.aws.opensearch.kotlin.AuthorizeVpcEndpointAccess.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.opensearch.kotlin
import com.pulumi.aws.opensearch.kotlin.outputs.AuthorizeVpcEndpointAccessAuthorizedPrincipal
import com.pulumi.aws.opensearch.kotlin.outputs.AuthorizeVpcEndpointAccessAuthorizedPrincipal.Companion.toKotlin
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
import kotlin.collections.List
/**
* Builder for [AuthorizeVpcEndpointAccess].
*/
@PulumiTagMarker
public class AuthorizeVpcEndpointAccessResourceBuilder internal constructor() {
public var name: String? = null
public var args: AuthorizeVpcEndpointAccessArgs = AuthorizeVpcEndpointAccessArgs()
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 AuthorizeVpcEndpointAccessArgsBuilder.() -> Unit) {
val builder = AuthorizeVpcEndpointAccessArgsBuilder()
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(): AuthorizeVpcEndpointAccess {
val builtJavaResource =
com.pulumi.aws.opensearch.AuthorizeVpcEndpointAccess(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AuthorizeVpcEndpointAccess(builtJavaResource)
}
}
/**
* Resource for managing an AWS OpenSearch Authorize Vpc Endpoint Access.
* ## Example Usage
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const current = aws.getCallerIdentity({});
* const test = new aws.opensearch.AuthorizeVpcEndpointAccess("test", {
* domainName: testAwsOpensearchDomain.domainName,
* account: current.then(current => current.accountId),
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* current = aws.get_caller_identity()
* test = aws.opensearch.AuthorizeVpcEndpointAccess("test",
* domain_name=test_aws_opensearch_domain["domainName"],
* account=current.account_id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var current = Aws.GetCallerIdentity.Invoke();
* var test = new Aws.OpenSearch.AuthorizeVpcEndpointAccess("test", new()
* {
* DomainName = testAwsOpensearchDomain.DomainName,
* Account = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
* if err != nil {
* return err
* }
* _, err = opensearch.NewAuthorizeVpcEndpointAccess(ctx, "test", &opensearch.AuthorizeVpcEndpointAccessArgs{
* DomainName: pulumi.Any(testAwsOpensearchDomain.DomainName),
* Account: pulumi.String(current.AccountId),
* })
* 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.AwsFunctions;
* import com.pulumi.aws.inputs.GetCallerIdentityArgs;
* import com.pulumi.aws.opensearch.AuthorizeVpcEndpointAccess;
* import com.pulumi.aws.opensearch.AuthorizeVpcEndpointAccessArgs;
* 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) {
* final var current = AwsFunctions.getCallerIdentity();
* var test = new AuthorizeVpcEndpointAccess("test", AuthorizeVpcEndpointAccessArgs.builder()
* .domainName(testAwsOpensearchDomain.domainName())
* .account(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:opensearch:AuthorizeVpcEndpointAccess
* properties:
* domainName: ${testAwsOpensearchDomain.domainName}
* account: ${current.accountId}
* variables:
* current:
* fn::invoke:
* Function: aws:getCallerIdentity
* Arguments: {}
* ```
*
* ## Import
* Using `pulumi import`, import OpenSearch Authorize Vpc Endpoint Access using the `example_id_arg`. For example:
* ```sh
* $ pulumi import aws:opensearch/authorizeVpcEndpointAccess:AuthorizeVpcEndpointAccess example authorize_vpc_endpoint_access-id-12345678
* ```
*/
public class AuthorizeVpcEndpointAccess internal constructor(
override val javaResource: com.pulumi.aws.opensearch.AuthorizeVpcEndpointAccess,
) : KotlinCustomResource(javaResource, AuthorizeVpcEndpointAccessMapper) {
/**
* AWS account ID to grant access to.
*/
public val account: Output
get() = javaResource.account().applyValue({ args0 -> args0 })
/**
* Information about the Amazon Web Services account or service that was provided access to the domain. See authorized principal attribute for further details.
*/
public val authorizedPrincipals: Output>
get() = javaResource.authorizedPrincipals().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
})
/**
* Name of OpenSearch Service domain to provide access to.
*/
public val domainName: Output
get() = javaResource.domainName().applyValue({ args0 -> args0 })
}
public object AuthorizeVpcEndpointAccessMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.opensearch.AuthorizeVpcEndpointAccess::class == javaResource::class
override fun map(javaResource: Resource): AuthorizeVpcEndpointAccess =
AuthorizeVpcEndpointAccess(
javaResource as
com.pulumi.aws.opensearch.AuthorizeVpcEndpointAccess,
)
}
/**
* @see [AuthorizeVpcEndpointAccess].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AuthorizeVpcEndpointAccess].
*/
public suspend fun authorizeVpcEndpointAccess(
name: String,
block: suspend AuthorizeVpcEndpointAccessResourceBuilder.() -> Unit,
): AuthorizeVpcEndpointAccess {
val builder = AuthorizeVpcEndpointAccessResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AuthorizeVpcEndpointAccess].
* @param name The _unique_ name of the resulting resource.
*/
public fun authorizeVpcEndpointAccess(name: String): AuthorizeVpcEndpointAccess {
val builder = AuthorizeVpcEndpointAccessResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy