1. Packages
  2. AWS
  3. API Docs
  4. controltower
  5. getControls
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
aws logo
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi

    List of Control Tower controls applied to an OU.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var thisOrganization = Aws.Organizations.GetOrganization.Invoke();
    
        var thisOrganizationalUnits = Aws.Organizations.GetOrganizationalUnits.Invoke(new()
        {
            ParentId = thisOrganization.Apply(getOrganizationResult => getOrganizationResult.Roots[0]?.Id),
        });
    
        var thisControls = Aws.ControlTower.GetControls.Invoke(new()
        {
            TargetIdentifier = .Where(x => x.Name == "Security").Select(x => 
            {
                return  x.Arn;
            })[0],
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/controltower"
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		thisOrganization, err := organizations.LookupOrganization(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		thisOrganizationalUnits, err := organizations.GetOrganizationalUnits(ctx, &organizations.GetOrganizationalUnitsArgs{
    			ParentId: thisOrganization.Roots[0].Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = controltower.GetControls(ctx, &controltower.GetControlsArgs{
    			TargetIdentifier: "TODO: For expression"[0],
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const thisOrganization = aws.organizations.getOrganization({});
    const thisOrganizationalUnits = thisOrganization.then(thisOrganization => aws.organizations.getOrganizationalUnits({
        parentId: thisOrganization.roots?.[0]?.id,
    }));
    const thisControls = thisOrganizationalUnits.then(thisOrganizationalUnits => aws.controltower.getControls({
        targetIdentifier: .filter(x => x.name == "Security").map(x => (x.arn))[0],
    }));
    
    import pulumi
    import pulumi_aws as aws
    
    this_organization = aws.organizations.get_organization()
    this_organizational_units = aws.organizations.get_organizational_units(parent_id=this_organization.roots[0].id)
    this_controls = aws.controltower.get_controls(target_identifier=[x.arn for x in this_organizational_units.childrens if x.name == "Security"][0])
    

    Example coming soon!

    Using getControls

    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 getControls(args: GetControlsArgs, opts?: InvokeOptions): Promise<GetControlsResult>
    function getControlsOutput(args: GetControlsOutputArgs, opts?: InvokeOptions): Output<GetControlsResult>
    def get_controls(target_identifier: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetControlsResult
    def get_controls_output(target_identifier: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetControlsResult]
    func GetControls(ctx *Context, args *GetControlsArgs, opts ...InvokeOption) (*GetControlsResult, error)
    func GetControlsOutput(ctx *Context, args *GetControlsOutputArgs, opts ...InvokeOption) GetControlsResultOutput

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

    public static class GetControls 
    {
        public static Task<GetControlsResult> InvokeAsync(GetControlsArgs args, InvokeOptions? opts = null)
        public static Output<GetControlsResult> Invoke(GetControlsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetControlsResult> getControls(GetControlsArgs args, InvokeOptions options)
    public static Output<GetControlsResult> getControls(GetControlsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:controltower/getControls:getControls
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TargetIdentifier string
    The ARN of the organizational unit.
    TargetIdentifier string
    The ARN of the organizational unit.
    targetIdentifier String
    The ARN of the organizational unit.
    targetIdentifier string
    The ARN of the organizational unit.
    target_identifier str
    The ARN of the organizational unit.
    targetIdentifier String
    The ARN of the organizational unit.

    getControls Result

    The following output properties are available:

    EnabledControls List<string>
    List of all the ARNs for the controls applied to the target_identifier.
    Id string
    The provider-assigned unique ID for this managed resource.
    TargetIdentifier string
    EnabledControls []string
    List of all the ARNs for the controls applied to the target_identifier.
    Id string
    The provider-assigned unique ID for this managed resource.
    TargetIdentifier string
    enabledControls List<String>
    List of all the ARNs for the controls applied to the target_identifier.
    id String
    The provider-assigned unique ID for this managed resource.
    targetIdentifier String
    enabledControls string[]
    List of all the ARNs for the controls applied to the target_identifier.
    id string
    The provider-assigned unique ID for this managed resource.
    targetIdentifier string
    enabled_controls Sequence[str]
    List of all the ARNs for the controls applied to the target_identifier.
    id str
    The provider-assigned unique ID for this managed resource.
    target_identifier str
    enabledControls List<String>
    List of all the ARNs for the controls applied to the target_identifier.
    id String
    The provider-assigned unique ID for this managed resource.
    targetIdentifier String

    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
    Viewing docs for AWS v5.43.0 (Older version)
    published on Tuesday, Mar 10, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.