Skip to content
v2.278.0

PolicyDetailProperty Struct ​

The configuration details for a lifecycle policy resource.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
const policyDetailProperty: imagebuilder.CfnLifecyclePolicy.PolicyDetailProperty = {
  action: {
    type: 'type',

    // the properties below are optional
    includeResources: {
      amis: false,
      containers: false,
      snapshots: false,
    },
  },
  filter: {
    type: 'type',
    value: 123,

    // the properties below are optional
    retainAtLeast: 123,
    unit: 'unit',
  },

  // the properties below are optional
  exclusionRules: {
    amis: {
      isPublic: false,
      lastLaunched: {
        unit: 'unit',
        value: 123,
      },
      regions: ['regions'],
      sharedAccounts: ['sharedAccounts'],
      tagMap: {
        tagMapKey: 'tagMap',
      },
    },
    tagMap: {
      tagMapKey: 'tagMap',
    },
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_imagebuilder as imagebuilder

policy_detail_property = imagebuilder.CfnLifecyclePolicy.PolicyDetailProperty(
    action=imagebuilder.CfnLifecyclePolicy.ActionProperty(
        type="type",

        # the properties below are optional
        include_resources=imagebuilder.CfnLifecyclePolicy.IncludeResourcesProperty(
            amis=False,
            containers=False,
            snapshots=False
        )
    ),
    filter=imagebuilder.CfnLifecyclePolicy.FilterProperty(
        type="type",
        value=123,

        # the properties below are optional
        retain_at_least=123,
        unit="unit"
    ),

    # the properties below are optional
    exclusion_rules=imagebuilder.CfnLifecyclePolicy.ExclusionRulesProperty(
        amis=imagebuilder.CfnLifecyclePolicy.AmiExclusionRulesProperty(
            is_public=False,
            last_launched=imagebuilder.CfnLifecyclePolicy.LastLaunchedProperty(
                unit="unit",
                value=123
            ),
            regions=["regions"],
            shared_accounts=["sharedAccounts"],
            tag_map={
                "tag_map_key": "tagMap"
            }
        ),
        tag_map={
            "tag_map_key": "tagMap"
        }
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.imagebuilder.*;

PolicyDetailProperty policyDetailProperty = PolicyDetailProperty.builder()
        .action(ActionProperty.builder()
                .type("type")

                // the properties below are optional
                .includeResources(IncludeResourcesProperty.builder()
                        .amis(false)
                        .containers(false)
                        .snapshots(false)
                        .build())
                .build())
        .filter(FilterProperty.builder()
                .type("type")
                .value(123)

                // the properties below are optional
                .retainAtLeast(123)
                .unit("unit")
                .build())

        // the properties below are optional
        .exclusionRules(ExclusionRulesProperty.builder()
                .amis(AmiExclusionRulesProperty.builder()
                        .isPublic(false)
                        .lastLaunched(LastLaunchedProperty.builder()
                                .unit("unit")
                                .value(123)
                                .build())
                        .regions(List.of("regions"))
                        .sharedAccounts(List.of("sharedAccounts"))
                        .tagMap(Map.of(
                                "tagMapKey", "tagMap"))
                        .build())
                .tagMap(Map.of(
                        "tagMapKey", "tagMap"))
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ImageBuilder;

var policyDetailProperty = new PolicyDetailProperty {
    Action = new ActionProperty {
        Type = "type",

        // the properties below are optional
        IncludeResources = new IncludeResourcesProperty {
            Amis = false,
            Containers = false,
            Snapshots = false
        }
    },
    Filter = new FilterProperty {
        Type = "type",
        Value = 123,

        // the properties below are optional
        RetainAtLeast = 123,
        Unit = "unit"
    },

    // the properties below are optional
    ExclusionRules = new ExclusionRulesProperty {
        Amis = new AmiExclusionRulesProperty {
            IsPublic = false,
            LastLaunched = new LastLaunchedProperty {
                Unit = "unit",
                Value = 123
            },
            Regions = new [] { "regions" },
            SharedAccounts = new [] { "sharedAccounts" },
            TagMap = new Dictionary<string, string> {
                { "tagMapKey", "tagMap" }
            }
        },
        TagMap = new Dictionary<string, string> {
            { "tagMapKey", "tagMap" }
        }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

policyDetailProperty := &PolicyDetailProperty{
	Action: &ActionProperty{
		Type: jsii.String("type"),

		// the properties below are optional
		IncludeResources: &IncludeResourcesProperty{
			Amis: jsii.Boolean(false),
			Containers: jsii.Boolean(false),
			Snapshots: jsii.Boolean(false),
		},
	},
	Filter: &FilterProperty{
		Type: jsii.String("type"),
		Value: jsii.Number(123),

		// the properties below are optional
		RetainAtLeast: jsii.Number(123),
		Unit: jsii.String("unit"),
	},

	// the properties below are optional
	ExclusionRules: &ExclusionRulesProperty{
		Amis: &AmiExclusionRulesProperty{
			IsPublic: jsii.Boolean(false),
			LastLaunched: &LastLaunchedProperty{
				Unit: jsii.String("unit"),
				Value: jsii.Number(123),
			},
			Regions: []*string{
				jsii.String("regions"),
			},
			SharedAccounts: []*string{
				jsii.String("sharedAccounts"),
			},
			TagMap: map[string]*string{
				"tagMapKey": jsii.String("tagMap"),
			},
		},
		TagMap: map[string]*string{
			"tagMapKey": jsii.String("tagMap"),
		},
	},
}

Properties ​

actionIResolvable | CfnLifecyclePolicy.ActionPropertyactiontyping.Union[IResolvable, ActionProperty]actionIResolvableActionIResolvableActioninterface{} required #
Configuration details for the policy action.
exclusionRulesoptionalIResolvable | CfnLifecyclePolicy.ExclusionRulesPropertyexclusion_rulesoptionaltyping.Union[IResolvable, ExclusionRulesProperty]exclusionRulesoptionalIResolvableExclusionRulesoptionalIResolvableExclusionRulesoptionalinterface{} #
Additional rules to specify resources that should be exempt from policy actions.
filterIResolvable | CfnLifecyclePolicy.FilterPropertyfiltertyping.Union[IResolvable, FilterProperty]filterIResolvableFilterIResolvableFilterinterface{} required #
Specifies the resources that the lifecycle policy applies to.