Class HmacKey


  • public class HmacKey
    extends com.pulumi.resources.CustomResource
    The hmacKeys resource represents an HMAC key within Cloud Storage. The resource consists of a secret and HMAC key metadata. HMAC keys can be used as credentials for service accounts. To get more information about HmacKey, see: * [API documentation](https://cloud.google.com/storage/docs/json_api/v1/projects/hmacKeys) * How-to Guides * [Official Documentation](https://cloud.google.com/storage/docs/authentication/managing-hmackeys) ## Example Usage ### Storage Hmac Key ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.serviceaccount.Account; import com.pulumi.gcp.serviceaccount.AccountArgs; import com.pulumi.gcp.storage.HmacKey; import com.pulumi.gcp.storage.HmacKeyArgs; 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 serviceAccount = new Account("serviceAccount", AccountArgs.builder() .accountId("my-svc-acc") .build()); var key = new HmacKey("key", HmacKeyArgs.builder() .serviceAccountEmail(serviceAccount.email()) .build()); } } ``` ## Import HmacKey can be imported using any of these accepted formats* `projects/{{project}}/hmacKeys/{{access_id}}` * `{{project}}/{{access_id}}` * `{{access_id}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import HmacKey using one of the formats above. For exampletf import { id = "projects/{{project}}/hmacKeys/{{access_id}}" to = google_storage_hmac_key.default } ```sh $ pulumi import gcp:storage/hmacKey:HmacKey When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), HmacKey can be imported using one of the formats above. For example ``` ```sh $ pulumi import gcp:storage/hmacKey:HmacKey default projects/{{project}}/hmacKeys/{{access_id}} ``` ```sh $ pulumi import gcp:storage/hmacKey:HmacKey default {{project}}/{{access_id}} ``` ```sh $ pulumi import gcp:storage/hmacKey:HmacKey default {{access_id}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      HmacKey​(java.lang.String name)  
      HmacKey​(java.lang.String name, HmacKeyArgs args)  
      HmacKey​(java.lang.String name, HmacKeyArgs 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> accessId()  
      static HmacKey get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, HmacKeyState 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> project()  
      com.pulumi.core.Output<java.lang.String> secret()  
      com.pulumi.core.Output<java.lang.String> serviceAccountEmail()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> state()  
      com.pulumi.core.Output<java.lang.String> timeCreated()  
      com.pulumi.core.Output<java.lang.String> updated()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HmacKey

        public HmacKey​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • HmacKey

        public HmacKey​(java.lang.String name,
                       HmacKeyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • HmacKey

        public HmacKey​(java.lang.String name,
                       HmacKeyArgs 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

      • accessId

        public com.pulumi.core.Output<java.lang.String> accessId()
        Returns:
        The access ID of the HMAC Key.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • secret

        public com.pulumi.core.Output<java.lang.String> secret()
        Returns:
        HMAC secret key material. **Note**: This property is sensitive and will not be displayed in the plan.
      • serviceAccountEmail

        public com.pulumi.core.Output<java.lang.String> serviceAccountEmail()
        Returns:
        The email address of the key's associated service account. ***
      • state

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> state()
        Returns:
        The state of the key. Can be set to one of ACTIVE, INACTIVE. Default value is `ACTIVE`. Possible values are: `ACTIVE`, `INACTIVE`.
      • timeCreated

        public com.pulumi.core.Output<java.lang.String> timeCreated()
        Returns:
        'The creation time of the HMAC key in RFC 3339 format. '
      • updated

        public com.pulumi.core.Output<java.lang.String> updated()
        Returns:
        'The last modification time of the HMAC key metadata in RFC 3339 format.'
      • get

        public static HmacKey get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  HmacKeyState 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.