Package com.pulumi.aws.iam
Class ServiceSpecificCredential
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.iam.ServiceSpecificCredential
-
public class ServiceSpecificCredential extends com.pulumi.resources.CustomResourceProvides an IAM Service Specific Credential. ## Example Usage ### Basic Usage
### Bedrock API Key with Expirationpackage 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.ArrayList; import java.util.Arrays; 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()); } }
## 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` ```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.ArrayList; import java.util.Arrays; 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 bedrock = new ServiceSpecificCredential("bedrock", ServiceSpecificCredentialArgs.builder() .serviceName("bedrock.amazonaws.com") .userName(example.name()) .credentialAgeDays(30) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description ServiceSpecificCredential(java.lang.String name)ServiceSpecificCredential(java.lang.String name, ServiceSpecificCredentialArgs args)ServiceSpecificCredential(java.lang.String name, ServiceSpecificCredentialArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>createDate()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>credentialAgeDays()com.pulumi.core.Output<java.lang.String>expirationDate()static ServiceSpecificCredentialget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ServiceSpecificCredentialState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>serviceCredentialAlias()com.pulumi.core.Output<java.lang.String>serviceCredentialSecret()com.pulumi.core.Output<java.lang.String>serviceName()com.pulumi.core.Output<java.lang.String>servicePassword()com.pulumi.core.Output<java.lang.String>serviceSpecificCredentialId()com.pulumi.core.Output<java.lang.String>serviceUserName()com.pulumi.core.Output<java.util.Optional<java.lang.String>>status()com.pulumi.core.Output<java.lang.String>userName()
-
-
-
Constructor Detail
-
ServiceSpecificCredential
public ServiceSpecificCredential(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ServiceSpecificCredential
public ServiceSpecificCredential(java.lang.String name, ServiceSpecificCredentialArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ServiceSpecificCredential
public ServiceSpecificCredential(java.lang.String name, ServiceSpecificCredentialArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
createDate
public com.pulumi.core.Output<java.lang.String> createDate()
- Returns:
- The date and time, in RFC3339 format, when the service-specific credential was created.
-
credentialAgeDays
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> credentialAgeDays()
- Returns:
- The number of days until the service specific credential expires. This field is only valid for Bedrock API keys and must be between 1 and 36600 (approximately 100 years). When not specified, the credential will not expire.
-
expirationDate
public com.pulumi.core.Output<java.lang.String> expirationDate()
- Returns:
- The date and time, in RFC3339 format, when the service specific credential expires. This field is only present for Bedrock API keys that were created with an expiration period.
-
serviceCredentialAlias
public com.pulumi.core.Output<java.lang.String> serviceCredentialAlias()
- Returns:
- For Bedrock API keys, this is the public portion of the credential that includes the IAM user name and a suffix containing version and creation information.
-
serviceCredentialSecret
public com.pulumi.core.Output<java.lang.String> serviceCredentialSecret()
- Returns:
- For Bedrock API keys, this is the secret portion of the credential that should be used to authenticate API calls. This value is only available when the credential is created.
-
serviceName
public com.pulumi.core.Output<java.lang.String> serviceName()
- Returns:
- 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. Supported services are `codecommit.amazonaws.com`, `bedrock.amazonaws.com`, and `cassandra.amazonaws.com`.
-
servicePassword
public com.pulumi.core.Output<java.lang.String> servicePassword()
- Returns:
- The generated password for the service-specific credential. This value is only available when the credential is created.
-
serviceSpecificCredentialId
public com.pulumi.core.Output<java.lang.String> serviceSpecificCredentialId()
- Returns:
- The unique identifier for the service-specific credential.
-
serviceUserName
public com.pulumi.core.Output<java.lang.String> serviceUserName()
- Returns:
- The generated user name for the service-specific credential. This value is generated by combining the IAM user's name combined with the ID number of the AWS account, as in `jane-at-123456789012`, for example.
-
status
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> status()
- Returns:
- The status to be assigned to the service-specific credential. Valid values are `Active`, `Inactive`, and `Expired`. Default value is `Active`. Note that `Expired` is only used for read operations and cannot be set manually.
-
userName
public com.pulumi.core.Output<java.lang.String> userName()
- Returns:
- 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.
-
get
public static ServiceSpecificCredential get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ServiceSpecificCredentialState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-