published on Tuesday, Mar 10, 2026 by Pulumi
published on Tuesday, Mar 10, 2026 by Pulumi
Provides an AWS Config Configuration Recorder. Please note that this resource does not start the created recorder automatically.
Note: Starting the Configuration Recorder requires a delivery channel (while delivery channel creation requires Configuration Recorder). This is why
aws.cfg.RecorderStatusis a separate resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var assumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Effect = "Allow",
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "Service",
Identifiers = new[]
{
"config.amazonaws.com",
},
},
},
Actions = new[]
{
"sts:AssumeRole",
},
},
},
});
var role = new Aws.Iam.Role("role", new()
{
AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
});
var foo = new Aws.Cfg.Recorder("foo", new()
{
RoleArn = role.Arn,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cfg"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Effect: pulumi.StringRef("Allow"),
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "Service",
Identifiers: []string{
"config.amazonaws.com",
},
},
},
Actions: []string{
"sts:AssumeRole",
},
},
},
}, nil)
if err != nil {
return err
}
role, err := iam.NewRole(ctx, "role", &iam.RoleArgs{
AssumeRolePolicy: *pulumi.String(assumeRole.Json),
})
if err != nil {
return err
}
_, err = cfg.NewRecorder(ctx, "foo", &cfg.RecorderArgs{
RoleArn: role.Arn,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.cfg.Recorder;
import com.pulumi.aws.cfg.RecorderArgs;
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 assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("config.amazonaws.com")
.build())
.actions("sts:AssumeRole")
.build())
.build());
var role = new Role("role", RoleArgs.builder()
.assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var foo = new Recorder("foo", RecorderArgs.builder()
.roleArn(role.arn())
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const assumeRole = aws.iam.getPolicyDocument({
statements: [{
effect: "Allow",
principals: [{
type: "Service",
identifiers: ["config.amazonaws.com"],
}],
actions: ["sts:AssumeRole"],
}],
});
const role = new aws.iam.Role("role", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)});
const foo = new aws.cfg.Recorder("foo", {roleArn: role.arn});
import pulumi
import pulumi_aws as aws
assume_role = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
effect="Allow",
principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
type="Service",
identifiers=["config.amazonaws.com"],
)],
actions=["sts:AssumeRole"],
)])
role = aws.iam.Role("role", assume_role_policy=assume_role.json)
foo = aws.cfg.Recorder("foo", role_arn=role.arn)
resources:
foo:
type: aws:cfg:Recorder
properties:
roleArn: ${role.arn}
role:
type: aws:iam:Role
properties:
assumeRolePolicy: ${assumeRole.json}
variables:
assumeRole:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- effect: Allow
principals:
- type: Service
identifiers:
- config.amazonaws.com
actions:
- sts:AssumeRole
Create Recorder Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Recorder(name: string, args: RecorderArgs, opts?: CustomResourceOptions);@overload
def Recorder(resource_name: str,
args: RecorderArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Recorder(resource_name: str,
opts: Optional[ResourceOptions] = None,
role_arn: Optional[str] = None,
name: Optional[str] = None,
recording_group: Optional[RecorderRecordingGroupArgs] = None)func NewRecorder(ctx *Context, name string, args RecorderArgs, opts ...ResourceOption) (*Recorder, error)public Recorder(string name, RecorderArgs args, CustomResourceOptions? opts = null)
public Recorder(String name, RecorderArgs args)
public Recorder(String name, RecorderArgs args, CustomResourceOptions options)
type: aws:cfg:Recorder
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RecorderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RecorderArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RecorderArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RecorderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RecorderArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var recorderResource = new Aws.Cfg.Recorder("recorderResource", new()
{
RoleArn = "string",
Name = "string",
RecordingGroup = new Aws.Cfg.Inputs.RecorderRecordingGroupArgs
{
AllSupported = false,
IncludeGlobalResourceTypes = false,
ResourceTypes = new[]
{
"string",
},
},
});
example, err := cfg.NewRecorder(ctx, "recorderResource", &cfg.RecorderArgs{
RoleArn: pulumi.String("string"),
Name: pulumi.String("string"),
RecordingGroup: &cfg.RecorderRecordingGroupArgs{
AllSupported: pulumi.Bool(false),
IncludeGlobalResourceTypes: pulumi.Bool(false),
ResourceTypes: pulumi.StringArray{
pulumi.String("string"),
},
},
})
var recorderResource = new Recorder("recorderResource", RecorderArgs.builder()
.roleArn("string")
.name("string")
.recordingGroup(RecorderRecordingGroupArgs.builder()
.allSupported(false)
.includeGlobalResourceTypes(false)
.resourceTypes("string")
.build())
.build());
recorder_resource = aws.cfg.Recorder("recorderResource",
role_arn="string",
name="string",
recording_group={
"all_supported": False,
"include_global_resource_types": False,
"resource_types": ["string"],
})
const recorderResource = new aws.cfg.Recorder("recorderResource", {
roleArn: "string",
name: "string",
recordingGroup: {
allSupported: false,
includeGlobalResourceTypes: false,
resourceTypes: ["string"],
},
});
type: aws:cfg:Recorder
properties:
name: string
recordingGroup:
allSupported: false
includeGlobalResourceTypes: false
resourceTypes:
- string
roleArn: string
Recorder Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Recorder resource accepts the following input properties:
- Role
Arn string - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- Name string
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - Recording
Group RecorderRecording Group - Recording group - see below.
- Role
Arn string - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- Name string
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - Recording
Group RecorderRecording Group Args - Recording group - see below.
- role
Arn String - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name String
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording
Group RecorderRecording Group - Recording group - see below.
- role
Arn string - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name string
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording
Group RecorderRecording Group - Recording group - see below.
- role_
arn str - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name str
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording_
group RecorderRecording Group Args - Recording group - see below.
- role
Arn String - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name String
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording
Group Property Map - Recording group - see below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Recorder resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Recorder Resource
Get an existing Recorder resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RecorderState, opts?: CustomResourceOptions): Recorder@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
recording_group: Optional[RecorderRecordingGroupArgs] = None,
role_arn: Optional[str] = None) -> Recorderfunc GetRecorder(ctx *Context, name string, id IDInput, state *RecorderState, opts ...ResourceOption) (*Recorder, error)public static Recorder Get(string name, Input<string> id, RecorderState? state, CustomResourceOptions? opts = null)public static Recorder get(String name, Output<String> id, RecorderState state, CustomResourceOptions options)resources: _: type: aws:cfg:Recorder get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Name string
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - Recording
Group RecorderRecording Group - Recording group - see below.
- Role
Arn string - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- Name string
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - Recording
Group RecorderRecording Group Args - Recording group - see below.
- Role
Arn string - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name String
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording
Group RecorderRecording Group - Recording group - see below.
- role
Arn String - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name string
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording
Group RecorderRecording Group - Recording group - see below.
- role
Arn string - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name str
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording_
group RecorderRecording Group Args - Recording group - see below.
- role_
arn str - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
- name String
- The name of the recorder. Defaults to
default. Changing it recreates the resource. - recording
Group Property Map - Recording group - see below.
- role
Arn String - Amazon Resource Name (ARN) of the IAM role. Used to make read or write requests to the delivery channel and to describe the AWS resources associated with the account. See AWS Docs for more details.
Supporting Types
RecorderRecordingGroup, RecorderRecordingGroupArgs
- All
Supported bool - Specifies whether AWS Config records configuration changes for every supported type of regional resource (which includes any new type that will become supported in the future). Conflicts with
resource_types. Defaults totrue. - Include
Global boolResource Types - Specifies whether AWS Config includes all supported types of global resources with the resources that it records. Requires
all_supported = true. Conflicts withresource_types. - Resource
Types List<string> - A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example,
AWS::EC2::InstanceorAWS::CloudTrail::Trail). See relevant part of AWS Docs for available types. In order to use this attribute,all_supportedmust be set to false.
- All
Supported bool - Specifies whether AWS Config records configuration changes for every supported type of regional resource (which includes any new type that will become supported in the future). Conflicts with
resource_types. Defaults totrue. - Include
Global boolResource Types - Specifies whether AWS Config includes all supported types of global resources with the resources that it records. Requires
all_supported = true. Conflicts withresource_types. - Resource
Types []string - A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example,
AWS::EC2::InstanceorAWS::CloudTrail::Trail). See relevant part of AWS Docs for available types. In order to use this attribute,all_supportedmust be set to false.
- all
Supported Boolean - Specifies whether AWS Config records configuration changes for every supported type of regional resource (which includes any new type that will become supported in the future). Conflicts with
resource_types. Defaults totrue. - include
Global BooleanResource Types - Specifies whether AWS Config includes all supported types of global resources with the resources that it records. Requires
all_supported = true. Conflicts withresource_types. - resource
Types List<String> - A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example,
AWS::EC2::InstanceorAWS::CloudTrail::Trail). See relevant part of AWS Docs for available types. In order to use this attribute,all_supportedmust be set to false.
- all
Supported boolean - Specifies whether AWS Config records configuration changes for every supported type of regional resource (which includes any new type that will become supported in the future). Conflicts with
resource_types. Defaults totrue. - include
Global booleanResource Types - Specifies whether AWS Config includes all supported types of global resources with the resources that it records. Requires
all_supported = true. Conflicts withresource_types. - resource
Types string[] - A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example,
AWS::EC2::InstanceorAWS::CloudTrail::Trail). See relevant part of AWS Docs for available types. In order to use this attribute,all_supportedmust be set to false.
- all_
supported bool - Specifies whether AWS Config records configuration changes for every supported type of regional resource (which includes any new type that will become supported in the future). Conflicts with
resource_types. Defaults totrue. - include_
global_ boolresource_ types - Specifies whether AWS Config includes all supported types of global resources with the resources that it records. Requires
all_supported = true. Conflicts withresource_types. - resource_
types Sequence[str] - A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example,
AWS::EC2::InstanceorAWS::CloudTrail::Trail). See relevant part of AWS Docs for available types. In order to use this attribute,all_supportedmust be set to false.
- all
Supported Boolean - Specifies whether AWS Config records configuration changes for every supported type of regional resource (which includes any new type that will become supported in the future). Conflicts with
resource_types. Defaults totrue. - include
Global BooleanResource Types - Specifies whether AWS Config includes all supported types of global resources with the resources that it records. Requires
all_supported = true. Conflicts withresource_types. - resource
Types List<String> - A list that specifies the types of AWS resources for which AWS Config records configuration changes (for example,
AWS::EC2::InstanceorAWS::CloudTrail::Trail). See relevant part of AWS Docs for available types. In order to use this attribute,all_supportedmust be set to false.
Import
Configuration Recorder can be imported using the name, e.g.,
$ pulumi import aws:cfg/recorder:Recorder foo example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Tuesday, Mar 10, 2026 by Pulumi
