1. Packages
  2. Volcengine
  3. API Docs
  4. kms
  5. getMacs
Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine
volcengine logo
Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine

    Use this data source to query detailed information of kms macs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    
    const mac = volcengine.kms.getMacs({
        keyId: "68093dd1-d1a9-44ce-****-5a88c4bc31ab",
        macAlgorithm: "HMAC_SHA_256",
        message: "VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=",
    });
    const verify = volcengine.kms.getMacVerifications({
        keyId: "68093dd1-d1a9-44ce-****-5a88c4bc31ab",
        mac: "Vm0D9fk6uDRZD6k9QZE9+d9gpgy6ESSPt0bfaA2p05w=",
        macAlgorithm: "HMAC_SHA_256",
        message: "VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=",
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    mac = volcengine.kms.get_macs(key_id="68093dd1-d1a9-44ce-****-5a88c4bc31ab",
        mac_algorithm="HMAC_SHA_256",
        message="VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=")
    verify = volcengine.kms.get_mac_verifications(key_id="68093dd1-d1a9-44ce-****-5a88c4bc31ab",
        mac="Vm0D9fk6uDRZD6k9QZE9+d9gpgy6ESSPt0bfaA2p05w=",
        mac_algorithm="HMAC_SHA_256",
        message="VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/kms"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.GetMacs(ctx, &kms.GetMacsArgs{
    			KeyId:        pulumi.StringRef("68093dd1-d1a9-44ce-****-5a88c4bc31ab"),
    			MacAlgorithm: "HMAC_SHA_256",
    			Message:      "VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = kms.GetMacVerifications(ctx, &kms.GetMacVerificationsArgs{
    			KeyId:        pulumi.StringRef("68093dd1-d1a9-44ce-****-5a88c4bc31ab"),
    			Mac:          "Vm0D9fk6uDRZD6k9QZE9+d9gpgy6ESSPt0bfaA2p05w=",
    			MacAlgorithm: "HMAC_SHA_256",
    			Message:      "VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var mac = Volcengine.Kms.GetMacs.Invoke(new()
        {
            KeyId = "68093dd1-d1a9-44ce-****-5a88c4bc31ab",
            MacAlgorithm = "HMAC_SHA_256",
            Message = "VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=",
        });
    
        var verify = Volcengine.Kms.GetMacVerifications.Invoke(new()
        {
            KeyId = "68093dd1-d1a9-44ce-****-5a88c4bc31ab",
            Mac = "Vm0D9fk6uDRZD6k9QZE9+d9gpgy6ESSPt0bfaA2p05w=",
            MacAlgorithm = "HMAC_SHA_256",
            Message = "VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.kms.KmsFunctions;
    import com.pulumi.volcengine.kms.inputs.GetMacsArgs;
    import com.pulumi.volcengine.kms.inputs.GetMacVerificationsArgs;
    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 mac = KmsFunctions.getMacs(GetMacsArgs.builder()
                .keyId("68093dd1-d1a9-44ce-****-5a88c4bc31ab")
                .macAlgorithm("HMAC_SHA_256")
                .message("VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=")
                .build());
    
            final var verify = KmsFunctions.getMacVerifications(GetMacVerificationsArgs.builder()
                .keyId("68093dd1-d1a9-44ce-****-5a88c4bc31ab")
                .mac("Vm0D9fk6uDRZD6k9QZE9+d9gpgy6ESSPt0bfaA2p05w=")
                .macAlgorithm("HMAC_SHA_256")
                .message("VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=")
                .build());
    
        }
    }
    
    variables:
      mac:
        fn::invoke:
          Function: volcengine:kms:getMacs
          Arguments:
            keyId: 68093dd1-d1a9-44ce-****-5a88c4bc31ab
            macAlgorithm: HMAC_SHA_256
            message: VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=
      verify:
        fn::invoke:
          Function: volcengine:kms:getMacVerifications
          Arguments:
            keyId: 68093dd1-d1a9-44ce-****-5a88c4bc31ab
            mac: Vm0D9fk6uDRZD6k9QZE9+d9gpgy6ESSPt0bfaA2p05w=
            macAlgorithm: HMAC_SHA_256
            message: VGhpcyBpcyBhIHRlc3QgTWVzc2FnZS4=
    

    Using getMacs

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getMacs(args: GetMacsArgs, opts?: InvokeOptions): Promise<GetMacsResult>
    function getMacsOutput(args: GetMacsOutputArgs, opts?: InvokeOptions): Output<GetMacsResult>
    def get_macs(key_id: Optional[str] = None,
                 key_name: Optional[str] = None,
                 keyring_name: Optional[str] = None,
                 mac_algorithm: Optional[str] = None,
                 message: Optional[str] = None,
                 output_file: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetMacsResult
    def get_macs_output(key_id: Optional[pulumi.Input[str]] = None,
                 key_name: Optional[pulumi.Input[str]] = None,
                 keyring_name: Optional[pulumi.Input[str]] = None,
                 mac_algorithm: Optional[pulumi.Input[str]] = None,
                 message: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetMacsResult]
    func GetMacs(ctx *Context, args *GetMacsArgs, opts ...InvokeOption) (*GetMacsResult, error)
    func GetMacsOutput(ctx *Context, args *GetMacsOutputArgs, opts ...InvokeOption) GetMacsResultOutput

    > Note: This function is named GetMacs in the Go SDK.

    public static class GetMacs 
    {
        public static Task<GetMacsResult> InvokeAsync(GetMacsArgs args, InvokeOptions? opts = null)
        public static Output<GetMacsResult> Invoke(GetMacsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMacsResult> getMacs(GetMacsArgs args, InvokeOptions options)
    public static Output<GetMacsResult> getMacs(GetMacsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: volcengine:kms/getMacs:getMacs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    MacAlgorithm string
    The MAC algorithm. Valid values: HMAC_SM3, HMAC_SHA_256.
    Message string
    The message, Base64 encoded. Generate a Hash-based Message Authentication Code (HMAC) for a message using an HMAC KMS key and a MAC algorithm supported by the key.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key.
    KeyringName string
    The name of the keyring.
    OutputFile string
    File name where to save data source results.
    MacAlgorithm string
    The MAC algorithm. Valid values: HMAC_SM3, HMAC_SHA_256.
    Message string
    The message, Base64 encoded. Generate a Hash-based Message Authentication Code (HMAC) for a message using an HMAC KMS key and a MAC algorithm supported by the key.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key.
    KeyringName string
    The name of the keyring.
    OutputFile string
    File name where to save data source results.
    macAlgorithm String
    The MAC algorithm. Valid values: HMAC_SM3, HMAC_SHA_256.
    message String
    The message, Base64 encoded. Generate a Hash-based Message Authentication Code (HMAC) for a message using an HMAC KMS key and a MAC algorithm supported by the key.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key.
    keyringName String
    The name of the keyring.
    outputFile String
    File name where to save data source results.
    macAlgorithm string
    The MAC algorithm. Valid values: HMAC_SM3, HMAC_SHA_256.
    message string
    The message, Base64 encoded. Generate a Hash-based Message Authentication Code (HMAC) for a message using an HMAC KMS key and a MAC algorithm supported by the key.
    keyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName string
    The name of the key.
    keyringName string
    The name of the keyring.
    outputFile string
    File name where to save data source results.
    mac_algorithm str
    The MAC algorithm. Valid values: HMAC_SM3, HMAC_SHA_256.
    message str
    The message, Base64 encoded. Generate a Hash-based Message Authentication Code (HMAC) for a message using an HMAC KMS key and a MAC algorithm supported by the key.
    key_id str
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    key_name str
    The name of the key.
    keyring_name str
    The name of the keyring.
    output_file str
    File name where to save data source results.
    macAlgorithm String
    The MAC algorithm. Valid values: HMAC_SM3, HMAC_SHA_256.
    message String
    The message, Base64 encoded. Generate a Hash-based Message Authentication Code (HMAC) for a message using an HMAC KMS key and a MAC algorithm supported by the key.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key.
    keyringName String
    The name of the keyring.
    outputFile String
    File name where to save data source results.

    getMacs Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    MacAlgorithm string
    MacInfos List<GetMacsMacInfo>
    The MAC info.
    Message string
    TotalCount int
    The total count of query.
    KeyId string
    The key id.
    KeyName string
    KeyringName string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    MacAlgorithm string
    MacInfos []GetMacsMacInfo
    The MAC info.
    Message string
    TotalCount int
    The total count of query.
    KeyId string
    The key id.
    KeyName string
    KeyringName string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    macAlgorithm String
    macInfos List<GetMacsMacInfo>
    The MAC info.
    message String
    totalCount Integer
    The total count of query.
    keyId String
    The key id.
    keyName String
    keyringName String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    macAlgorithm string
    macInfos GetMacsMacInfo[]
    The MAC info.
    message string
    totalCount number
    The total count of query.
    keyId string
    The key id.
    keyName string
    keyringName string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    mac_algorithm str
    mac_infos Sequence[GetMacsMacInfo]
    The MAC info.
    message str
    total_count int
    The total count of query.
    key_id str
    The key id.
    key_name str
    keyring_name str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    macAlgorithm String
    macInfos List<Property Map>
    The MAC info.
    message String
    totalCount Number
    The total count of query.
    keyId String
    The key id.
    keyName String
    keyringName String
    outputFile String

    Supporting Types

    GetMacsMacInfo

    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    Mac string
    The MAC result, Base64 encoded.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    Mac string
    The MAC result, Base64 encoded.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    mac String
    The MAC result, Base64 encoded.
    keyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    mac string
    The MAC result, Base64 encoded.
    key_id str
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    mac str
    The MAC result, Base64 encoded.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    mac String
    The MAC result, Base64 encoded.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate