1. Packages
  2. AWS
  3. API Docs
  4. cfg
  5. RetentionConfiguration
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.cfg.RetentionConfiguration

Explore with Pulumi AI

Provides a resource to manage the AWS Config retention configuration. The retention configuration defines the number of days that AWS Config stores historical information.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cfg.RetentionConfiguration("example", {retentionPeriodInDays: 90});
Copy
import pulumi
import pulumi_aws as aws

example = aws.cfg.RetentionConfiguration("example", retention_period_in_days=90)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cfg"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cfg.NewRetentionConfiguration(ctx, "example", &cfg.RetentionConfigurationArgs{
			RetentionPeriodInDays: pulumi.Int(90),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Cfg.RetentionConfiguration("example", new()
    {
        RetentionPeriodInDays = 90,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cfg.RetentionConfiguration;
import com.pulumi.aws.cfg.RetentionConfigurationArgs;
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 example = new RetentionConfiguration("example", RetentionConfigurationArgs.builder()
            .retentionPeriodInDays(90)
            .build());

    }
}
Copy
resources:
  example:
    type: aws:cfg:RetentionConfiguration
    properties:
      retentionPeriodInDays: 90
Copy

Create RetentionConfiguration Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RetentionConfiguration(name: string, args: RetentionConfigurationArgs, opts?: CustomResourceOptions);
@overload
def RetentionConfiguration(resource_name: str,
                           args: RetentionConfigurationArgs,
                           opts: Optional[ResourceOptions] = None)

@overload
def RetentionConfiguration(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           retention_period_in_days: Optional[int] = None)
func NewRetentionConfiguration(ctx *Context, name string, args RetentionConfigurationArgs, opts ...ResourceOption) (*RetentionConfiguration, error)
public RetentionConfiguration(string name, RetentionConfigurationArgs args, CustomResourceOptions? opts = null)
public RetentionConfiguration(String name, RetentionConfigurationArgs args)
public RetentionConfiguration(String name, RetentionConfigurationArgs args, CustomResourceOptions options)
type: aws:cfg:RetentionConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RetentionConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RetentionConfigurationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RetentionConfigurationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RetentionConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RetentionConfigurationArgs
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 retentionConfigurationResource = new Aws.Cfg.RetentionConfiguration("retentionConfigurationResource", new()
{
    RetentionPeriodInDays = 0,
});
Copy
example, err := cfg.NewRetentionConfiguration(ctx, "retentionConfigurationResource", &cfg.RetentionConfigurationArgs{
	RetentionPeriodInDays: pulumi.Int(0),
})
Copy
var retentionConfigurationResource = new RetentionConfiguration("retentionConfigurationResource", RetentionConfigurationArgs.builder()
    .retentionPeriodInDays(0)
    .build());
Copy
retention_configuration_resource = aws.cfg.RetentionConfiguration("retentionConfigurationResource", retention_period_in_days=0)
Copy
const retentionConfigurationResource = new aws.cfg.RetentionConfiguration("retentionConfigurationResource", {retentionPeriodInDays: 0});
Copy
type: aws:cfg:RetentionConfiguration
properties:
    retentionPeriodInDays: 0
Copy

RetentionConfiguration 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 RetentionConfiguration resource accepts the following input properties:

RetentionPeriodInDays This property is required. int
The number of days AWS Config stores historical information.
RetentionPeriodInDays This property is required. int
The number of days AWS Config stores historical information.
retentionPeriodInDays This property is required. Integer
The number of days AWS Config stores historical information.
retentionPeriodInDays This property is required. number
The number of days AWS Config stores historical information.
retention_period_in_days This property is required. int
The number of days AWS Config stores historical information.
retentionPeriodInDays This property is required. Number
The number of days AWS Config stores historical information.

Outputs

All input properties are implicitly available as output properties. Additionally, the RetentionConfiguration resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the retention configuration object. The object is always named default.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the retention configuration object. The object is always named default.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the retention configuration object. The object is always named default.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the retention configuration object. The object is always named default.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the retention configuration object. The object is always named default.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the retention configuration object. The object is always named default.

Look up Existing RetentionConfiguration Resource

Get an existing RetentionConfiguration 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?: RetentionConfigurationState, opts?: CustomResourceOptions): RetentionConfiguration
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        retention_period_in_days: Optional[int] = None) -> RetentionConfiguration
func GetRetentionConfiguration(ctx *Context, name string, id IDInput, state *RetentionConfigurationState, opts ...ResourceOption) (*RetentionConfiguration, error)
public static RetentionConfiguration Get(string name, Input<string> id, RetentionConfigurationState? state, CustomResourceOptions? opts = null)
public static RetentionConfiguration get(String name, Output<String> id, RetentionConfigurationState state, CustomResourceOptions options)
resources:  _:    type: aws:cfg:RetentionConfiguration    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Name string
The name of the retention configuration object. The object is always named default.
RetentionPeriodInDays int
The number of days AWS Config stores historical information.
Name string
The name of the retention configuration object. The object is always named default.
RetentionPeriodInDays int
The number of days AWS Config stores historical information.
name String
The name of the retention configuration object. The object is always named default.
retentionPeriodInDays Integer
The number of days AWS Config stores historical information.
name string
The name of the retention configuration object. The object is always named default.
retentionPeriodInDays number
The number of days AWS Config stores historical information.
name str
The name of the retention configuration object. The object is always named default.
retention_period_in_days int
The number of days AWS Config stores historical information.
name String
The name of the retention configuration object. The object is always named default.
retentionPeriodInDays Number
The number of days AWS Config stores historical information.

Import

Using pulumi import, import the AWS Config retention configuration using the name. For example:

$ pulumi import aws:cfg/retentionConfiguration:RetentionConfiguration example default
Copy

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 aws Terraform Provider.