com.pulumi.aws.iam.kotlin.ServiceSpecificCredentialArgs.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.iam.kotlin
import com.pulumi.aws.iam.ServiceSpecificCredentialArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides an IAM Service Specific Credential.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.iam.User("example", {name: "example"});
* const exampleServiceSpecificCredential = new aws.iam.ServiceSpecificCredential("example", {
* serviceName: "codecommit.amazonaws.com",
* userName: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.iam.User("example", name="example")
* example_service_specific_credential = aws.iam.ServiceSpecificCredential("example",
* service_name="codecommit.amazonaws.com",
* user_name=example.name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Iam.User("example", new()
* {
* Name = "example",
* });
* var exampleServiceSpecificCredential = new Aws.Iam.ServiceSpecificCredential("example", new()
* {
* ServiceName = "codecommit.amazonaws.com",
* UserName = example.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := iam.NewUser(ctx, "example", &iam.UserArgs{
* Name: pulumi.String("example"),
* })
* if err != nil {
* return err
* }
* _, err = iam.NewServiceSpecificCredential(ctx, "example", &iam.ServiceSpecificCredentialArgs{
* ServiceName: pulumi.String("codecommit.amazonaws.com"),
* UserName: example.Name,
* })
* 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.iam.User;
* import com.pulumi.aws.iam.UserArgs;
* import com.pulumi.aws.iam.ServiceSpecificCredential;
* import com.pulumi.aws.iam.ServiceSpecificCredentialArgs;
* 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 User("example", UserArgs.builder()
* .name("example")
* .build());
* var exampleServiceSpecificCredential = new ServiceSpecificCredential("exampleServiceSpecificCredential", ServiceSpecificCredentialArgs.builder()
* .serviceName("codecommit.amazonaws.com")
* .userName(example.name())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:iam:User
* properties:
* name: example
* exampleServiceSpecificCredential:
* type: aws:iam:ServiceSpecificCredential
* name: example
* properties:
* serviceName: codecommit.amazonaws.com
* userName: ${example.name}
* ```
*
* ## Import
* Using `pulumi import`, import IAM Service Specific Credentials using the `service_name:user_name:service_specific_credential_id`. For example:
* ```sh
* $ pulumi import aws:iam/serviceSpecificCredential:ServiceSpecificCredential default `codecommit.amazonaws.com:example:some-id`
* ```
* @property serviceName The name of the AWS service that is to be associated with the credentials. The service you specify here is the only service that can be accessed using these credentials.
* @property status The status to be assigned to the service-specific credential. Valid values are `Active` and `Inactive`. Default value is `Active`.
* @property userName The name of the IAM user that is to be associated with the credentials. The new service-specific credentials have the same permissions as the associated user except that they can be used only to access the specified service.
*/
public data class ServiceSpecificCredentialArgs(
public val serviceName: Output? = null,
public val status: Output? = null,
public val userName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.iam.ServiceSpecificCredentialArgs =
com.pulumi.aws.iam.ServiceSpecificCredentialArgs.builder()
.serviceName(serviceName?.applyValue({ args0 -> args0 }))
.status(status?.applyValue({ args0 -> args0 }))
.userName(userName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ServiceSpecificCredentialArgs].
*/
@PulumiTagMarker
public class ServiceSpecificCredentialArgsBuilder internal constructor() {
private var serviceName: Output? = null
private var status: Output? = null
private var userName: Output? = null
/**
* @param value The name of the AWS service that is to be associated with the credentials. The service you specify here is the only service that can be accessed using these credentials.
*/
@JvmName("ramobykkllcdxabs")
public suspend fun serviceName(`value`: Output) {
this.serviceName = value
}
/**
* @param value The status to be assigned to the service-specific credential. Valid values are `Active` and `Inactive`. Default value is `Active`.
*/
@JvmName("fniryjevgusjhkvl")
public suspend fun status(`value`: Output) {
this.status = value
}
/**
* @param value The name of the IAM user that is to be associated with the credentials. The new service-specific credentials have the same permissions as the associated user except that they can be used only to access the specified service.
*/
@JvmName("yewllonuekirgtlu")
public suspend fun userName(`value`: Output) {
this.userName = value
}
/**
* @param value The name of the AWS service that is to be associated with the credentials. The service you specify here is the only service that can be accessed using these credentials.
*/
@JvmName("csxhsruefflhwxlx")
public suspend fun serviceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.serviceName = mapped
}
/**
* @param value The status to be assigned to the service-specific credential. Valid values are `Active` and `Inactive`. Default value is `Active`.
*/
@JvmName("qnakkhmsjymmyure")
public suspend fun status(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.status = mapped
}
/**
* @param value The name of the IAM user that is to be associated with the credentials. The new service-specific credentials have the same permissions as the associated user except that they can be used only to access the specified service.
*/
@JvmName("ofmhfvwmpfdcmbde")
public suspend fun userName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.userName = mapped
}
internal fun build(): ServiceSpecificCredentialArgs = ServiceSpecificCredentialArgs(
serviceName = serviceName,
status = status,
userName = userName,
)
}