1. Packages
  2. AWS
  3. API Docs
  4. auditmanager
  5. getControl
AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi

aws.auditmanager.getControl

Explore with Pulumi AI

aws logo
AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi

    Data source for managing an AWS Audit Manager Control.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.auditmanager.getControl({
        name: "1. Risk Management",
        type: "Standard",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.auditmanager.get_control(name="1. Risk Management",
        type="Standard")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/auditmanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := auditmanager.LookupControl(ctx, &auditmanager.LookupControlArgs{
    			Name: "1. Risk Management",
    			Type: "Standard",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Auditmanager.GetControl.Invoke(new()
        {
            Name = "1. Risk Management",
            Type = "Standard",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.auditmanager.AuditmanagerFunctions;
    import com.pulumi.aws.auditmanager.inputs.GetControlArgs;
    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 example = AuditmanagerFunctions.getControl(GetControlArgs.builder()
                .name("1. Risk Management")
                .type("Standard")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:auditmanager:getControl
          Arguments:
            name: 1. Risk Management
            type: Standard
    

    With Framework Resource

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.auditmanager.getControl({
        name: "1. Risk Management",
        type: "Standard",
    });
    const example2 = aws.auditmanager.getControl({
        name: "2. Personnel",
        type: "Standard",
    });
    const exampleFramework = new aws.auditmanager.Framework("example", {
        name: "example",
        controlSets: [
            {
                name: "example",
                controls: [{
                    id: example.then(example => example.id),
                }],
            },
            {
                name: "example2",
                controls: [{
                    id: example2.then(example2 => example2.id),
                }],
            },
        ],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.auditmanager.get_control(name="1. Risk Management",
        type="Standard")
    example2 = aws.auditmanager.get_control(name="2. Personnel",
        type="Standard")
    example_framework = aws.auditmanager.Framework("example",
        name="example",
        control_sets=[
            {
                "name": "example",
                "controls": [{
                    "id": example.id,
                }],
            },
            {
                "name": "example2",
                "controls": [{
                    "id": example2.id,
                }],
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/auditmanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := auditmanager.LookupControl(ctx, &auditmanager.LookupControlArgs{
    			Name: "1. Risk Management",
    			Type: "Standard",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		example2, err := auditmanager.LookupControl(ctx, &auditmanager.LookupControlArgs{
    			Name: "2. Personnel",
    			Type: "Standard",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = auditmanager.NewFramework(ctx, "example", &auditmanager.FrameworkArgs{
    			Name: pulumi.String("example"),
    			ControlSets: auditmanager.FrameworkControlSetArray{
    				&auditmanager.FrameworkControlSetArgs{
    					Name: pulumi.String("example"),
    					Controls: auditmanager.FrameworkControlSetControlArray{
    						&auditmanager.FrameworkControlSetControlArgs{
    							Id: pulumi.String(example.Id),
    						},
    					},
    				},
    				&auditmanager.FrameworkControlSetArgs{
    					Name: pulumi.String("example2"),
    					Controls: auditmanager.FrameworkControlSetControlArray{
    						&auditmanager.FrameworkControlSetControlArgs{
    							Id: pulumi.String(example2.Id),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Auditmanager.GetControl.Invoke(new()
        {
            Name = "1. Risk Management",
            Type = "Standard",
        });
    
        var example2 = Aws.Auditmanager.GetControl.Invoke(new()
        {
            Name = "2. Personnel",
            Type = "Standard",
        });
    
        var exampleFramework = new Aws.Auditmanager.Framework("example", new()
        {
            Name = "example",
            ControlSets = new[]
            {
                new Aws.Auditmanager.Inputs.FrameworkControlSetArgs
                {
                    Name = "example",
                    Controls = new[]
                    {
                        new Aws.Auditmanager.Inputs.FrameworkControlSetControlArgs
                        {
                            Id = example.Apply(getControlResult => getControlResult.Id),
                        },
                    },
                },
                new Aws.Auditmanager.Inputs.FrameworkControlSetArgs
                {
                    Name = "example2",
                    Controls = new[]
                    {
                        new Aws.Auditmanager.Inputs.FrameworkControlSetControlArgs
                        {
                            Id = example2.Apply(getControlResult => getControlResult.Id),
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.auditmanager.AuditmanagerFunctions;
    import com.pulumi.aws.auditmanager.inputs.GetControlArgs;
    import com.pulumi.aws.auditmanager.Framework;
    import com.pulumi.aws.auditmanager.FrameworkArgs;
    import com.pulumi.aws.auditmanager.inputs.FrameworkControlSetArgs;
    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 example = AuditmanagerFunctions.getControl(GetControlArgs.builder()
                .name("1. Risk Management")
                .type("Standard")
                .build());
    
            final var example2 = AuditmanagerFunctions.getControl(GetControlArgs.builder()
                .name("2. Personnel")
                .type("Standard")
                .build());
    
            var exampleFramework = new Framework("exampleFramework", FrameworkArgs.builder()
                .name("example")
                .controlSets(            
                    FrameworkControlSetArgs.builder()
                        .name("example")
                        .controls(FrameworkControlSetControlArgs.builder()
                            .id(example.applyValue(getControlResult -> getControlResult.id()))
                            .build())
                        .build(),
                    FrameworkControlSetArgs.builder()
                        .name("example2")
                        .controls(FrameworkControlSetControlArgs.builder()
                            .id(example2.applyValue(getControlResult -> getControlResult.id()))
                            .build())
                        .build())
                .build());
    
        }
    }
    
    resources:
      exampleFramework:
        type: aws:auditmanager:Framework
        name: example
        properties:
          name: example
          controlSets:
            - name: example
              controls:
                - id: ${example.id}
            - name: example2
              controls:
                - id: ${example2.id}
    variables:
      example:
        fn::invoke:
          Function: aws:auditmanager:getControl
          Arguments:
            name: 1. Risk Management
            type: Standard
      example2:
        fn::invoke:
          Function: aws:auditmanager:getControl
          Arguments:
            name: 2. Personnel
            type: Standard
    

    Using getControl

    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 getControl(args: GetControlArgs, opts?: InvokeOptions): Promise<GetControlResult>
    function getControlOutput(args: GetControlOutputArgs, opts?: InvokeOptions): Output<GetControlResult>
    def get_control(control_mapping_sources: Optional[Sequence[GetControlControlMappingSource]] = None,
                    name: Optional[str] = None,
                    type: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetControlResult
    def get_control_output(control_mapping_sources: Optional[pulumi.Input[Sequence[pulumi.Input[GetControlControlMappingSourceArgs]]]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    type: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetControlResult]
    func LookupControl(ctx *Context, args *LookupControlArgs, opts ...InvokeOption) (*LookupControlResult, error)
    func LookupControlOutput(ctx *Context, args *LookupControlOutputArgs, opts ...InvokeOption) LookupControlResultOutput

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

    public static class GetControl 
    {
        public static Task<GetControlResult> InvokeAsync(GetControlArgs args, InvokeOptions? opts = null)
        public static Output<GetControlResult> Invoke(GetControlInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetControlResult> getControl(GetControlArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:auditmanager/getControl:getControl
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name of the control.
    Type string
    Type of control. Valid values are Custom and Standard.
    ControlMappingSources List<GetControlControlMappingSource>
    Name string
    Name of the control.
    Type string
    Type of control. Valid values are Custom and Standard.
    ControlMappingSources []GetControlControlMappingSource
    name String
    Name of the control.
    type String
    Type of control. Valid values are Custom and Standard.
    controlMappingSources List<GetControlControlMappingSource>
    name string
    Name of the control.
    type string
    Type of control. Valid values are Custom and Standard.
    controlMappingSources GetControlControlMappingSource[]
    name str
    Name of the control.
    type str
    Type of control. Valid values are Custom and Standard.
    control_mapping_sources Sequence[GetControlControlMappingSource]
    name String
    Name of the control.
    type String
    Type of control. Valid values are Custom and Standard.
    controlMappingSources List<Property Map>

    getControl Result

    The following output properties are available:

    Supporting Types

    GetControlControlMappingSource

    GetControlControlMappingSourceSourceKeyword

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi