1. Packages
  2. AWS
  3. API Docs
  4. ecr
  5. RegistryScanningConfiguration
AWS v6.77.1 published on Friday, Apr 18, 2025 by Pulumi

aws.ecr.RegistryScanningConfiguration

Explore with Pulumi AI

Provides an Elastic Container Registry Scanning Configuration. Can’t be completely deleted, instead reverts to the default BASIC scanning configuration without rules.

Example Usage

Basic example

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

const configuration = new aws.ecr.RegistryScanningConfiguration("configuration", {
    scanType: "ENHANCED",
    rules: [{
        scanFrequency: "CONTINUOUS_SCAN",
        repositoryFilters: [{
            filter: "example",
            filterType: "WILDCARD",
        }],
    }],
});
Copy
import pulumi
import pulumi_aws as aws

configuration = aws.ecr.RegistryScanningConfiguration("configuration",
    scan_type="ENHANCED",
    rules=[{
        "scan_frequency": "CONTINUOUS_SCAN",
        "repository_filters": [{
            "filter": "example",
            "filter_type": "WILDCARD",
        }],
    }])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecr.NewRegistryScanningConfiguration(ctx, "configuration", &ecr.RegistryScanningConfigurationArgs{
			ScanType: pulumi.String("ENHANCED"),
			Rules: ecr.RegistryScanningConfigurationRuleArray{
				&ecr.RegistryScanningConfigurationRuleArgs{
					ScanFrequency: pulumi.String("CONTINUOUS_SCAN"),
					RepositoryFilters: ecr.RegistryScanningConfigurationRuleRepositoryFilterArray{
						&ecr.RegistryScanningConfigurationRuleRepositoryFilterArgs{
							Filter:     pulumi.String("example"),
							FilterType: pulumi.String("WILDCARD"),
						},
					},
				},
			},
		})
		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 configuration = new Aws.Ecr.RegistryScanningConfiguration("configuration", new()
    {
        ScanType = "ENHANCED",
        Rules = new[]
        {
            new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleArgs
            {
                ScanFrequency = "CONTINUOUS_SCAN",
                RepositoryFilters = new[]
                {
                    new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleRepositoryFilterArgs
                    {
                        Filter = "example",
                        FilterType = "WILDCARD",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecr.RegistryScanningConfiguration;
import com.pulumi.aws.ecr.RegistryScanningConfigurationArgs;
import com.pulumi.aws.ecr.inputs.RegistryScanningConfigurationRuleArgs;
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 configuration = new RegistryScanningConfiguration("configuration", RegistryScanningConfigurationArgs.builder()
            .scanType("ENHANCED")
            .rules(RegistryScanningConfigurationRuleArgs.builder()
                .scanFrequency("CONTINUOUS_SCAN")
                .repositoryFilters(RegistryScanningConfigurationRuleRepositoryFilterArgs.builder()
                    .filter("example")
                    .filterType("WILDCARD")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  configuration:
    type: aws:ecr:RegistryScanningConfiguration
    properties:
      scanType: ENHANCED
      rules:
        - scanFrequency: CONTINUOUS_SCAN
          repositoryFilters:
            - filter: example
              filterType: WILDCARD
Copy

Multiple rules

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

const test = new aws.ecr.RegistryScanningConfiguration("test", {
    scanType: "ENHANCED",
    rules: [
        {
            scanFrequency: "SCAN_ON_PUSH",
            repositoryFilters: [{
                filter: "*",
                filterType: "WILDCARD",
            }],
        },
        {
            scanFrequency: "CONTINUOUS_SCAN",
            repositoryFilters: [{
                filter: "example",
                filterType: "WILDCARD",
            }],
        },
    ],
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.ecr.RegistryScanningConfiguration("test",
    scan_type="ENHANCED",
    rules=[
        {
            "scan_frequency": "SCAN_ON_PUSH",
            "repository_filters": [{
                "filter": "*",
                "filter_type": "WILDCARD",
            }],
        },
        {
            "scan_frequency": "CONTINUOUS_SCAN",
            "repository_filters": [{
                "filter": "example",
                "filter_type": "WILDCARD",
            }],
        },
    ])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecr.NewRegistryScanningConfiguration(ctx, "test", &ecr.RegistryScanningConfigurationArgs{
			ScanType: pulumi.String("ENHANCED"),
			Rules: ecr.RegistryScanningConfigurationRuleArray{
				&ecr.RegistryScanningConfigurationRuleArgs{
					ScanFrequency: pulumi.String("SCAN_ON_PUSH"),
					RepositoryFilters: ecr.RegistryScanningConfigurationRuleRepositoryFilterArray{
						&ecr.RegistryScanningConfigurationRuleRepositoryFilterArgs{
							Filter:     pulumi.String("*"),
							FilterType: pulumi.String("WILDCARD"),
						},
					},
				},
				&ecr.RegistryScanningConfigurationRuleArgs{
					ScanFrequency: pulumi.String("CONTINUOUS_SCAN"),
					RepositoryFilters: ecr.RegistryScanningConfigurationRuleRepositoryFilterArray{
						&ecr.RegistryScanningConfigurationRuleRepositoryFilterArgs{
							Filter:     pulumi.String("example"),
							FilterType: pulumi.String("WILDCARD"),
						},
					},
				},
			},
		})
		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 test = new Aws.Ecr.RegistryScanningConfiguration("test", new()
    {
        ScanType = "ENHANCED",
        Rules = new[]
        {
            new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleArgs
            {
                ScanFrequency = "SCAN_ON_PUSH",
                RepositoryFilters = new[]
                {
                    new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleRepositoryFilterArgs
                    {
                        Filter = "*",
                        FilterType = "WILDCARD",
                    },
                },
            },
            new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleArgs
            {
                ScanFrequency = "CONTINUOUS_SCAN",
                RepositoryFilters = new[]
                {
                    new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleRepositoryFilterArgs
                    {
                        Filter = "example",
                        FilterType = "WILDCARD",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecr.RegistryScanningConfiguration;
import com.pulumi.aws.ecr.RegistryScanningConfigurationArgs;
import com.pulumi.aws.ecr.inputs.RegistryScanningConfigurationRuleArgs;
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 test = new RegistryScanningConfiguration("test", RegistryScanningConfigurationArgs.builder()
            .scanType("ENHANCED")
            .rules(            
                RegistryScanningConfigurationRuleArgs.builder()
                    .scanFrequency("SCAN_ON_PUSH")
                    .repositoryFilters(RegistryScanningConfigurationRuleRepositoryFilterArgs.builder()
                        .filter("*")
                        .filterType("WILDCARD")
                        .build())
                    .build(),
                RegistryScanningConfigurationRuleArgs.builder()
                    .scanFrequency("CONTINUOUS_SCAN")
                    .repositoryFilters(RegistryScanningConfigurationRuleRepositoryFilterArgs.builder()
                        .filter("example")
                        .filterType("WILDCARD")
                        .build())
                    .build())
            .build());

    }
}
Copy
resources:
  test:
    type: aws:ecr:RegistryScanningConfiguration
    properties:
      scanType: ENHANCED
      rules:
        - scanFrequency: SCAN_ON_PUSH
          repositoryFilters:
            - filter: '*'
              filterType: WILDCARD
        - scanFrequency: CONTINUOUS_SCAN
          repositoryFilters:
            - filter: example
              filterType: WILDCARD
Copy

Create RegistryScanningConfiguration Resource

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

Constructor syntax

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

@overload
def RegistryScanningConfiguration(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  scan_type: Optional[str] = None,
                                  rules: Optional[Sequence[RegistryScanningConfigurationRuleArgs]] = None)
func NewRegistryScanningConfiguration(ctx *Context, name string, args RegistryScanningConfigurationArgs, opts ...ResourceOption) (*RegistryScanningConfiguration, error)
public RegistryScanningConfiguration(string name, RegistryScanningConfigurationArgs args, CustomResourceOptions? opts = null)
public RegistryScanningConfiguration(String name, RegistryScanningConfigurationArgs args)
public RegistryScanningConfiguration(String name, RegistryScanningConfigurationArgs args, CustomResourceOptions options)
type: aws:ecr:RegistryScanningConfiguration
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. RegistryScanningConfigurationArgs
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. RegistryScanningConfigurationArgs
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. RegistryScanningConfigurationArgs
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. RegistryScanningConfigurationArgs
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. RegistryScanningConfigurationArgs
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 registryScanningConfigurationResource = new Aws.Ecr.RegistryScanningConfiguration("registryScanningConfigurationResource", new()
{
    ScanType = "string",
    Rules = new[]
    {
        new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleArgs
        {
            RepositoryFilters = new[]
            {
                new Aws.Ecr.Inputs.RegistryScanningConfigurationRuleRepositoryFilterArgs
                {
                    Filter = "string",
                    FilterType = "string",
                },
            },
            ScanFrequency = "string",
        },
    },
});
Copy
example, err := ecr.NewRegistryScanningConfiguration(ctx, "registryScanningConfigurationResource", &ecr.RegistryScanningConfigurationArgs{
	ScanType: pulumi.String("string"),
	Rules: ecr.RegistryScanningConfigurationRuleArray{
		&ecr.RegistryScanningConfigurationRuleArgs{
			RepositoryFilters: ecr.RegistryScanningConfigurationRuleRepositoryFilterArray{
				&ecr.RegistryScanningConfigurationRuleRepositoryFilterArgs{
					Filter:     pulumi.String("string"),
					FilterType: pulumi.String("string"),
				},
			},
			ScanFrequency: pulumi.String("string"),
		},
	},
})
Copy
var registryScanningConfigurationResource = new RegistryScanningConfiguration("registryScanningConfigurationResource", RegistryScanningConfigurationArgs.builder()
    .scanType("string")
    .rules(RegistryScanningConfigurationRuleArgs.builder()
        .repositoryFilters(RegistryScanningConfigurationRuleRepositoryFilterArgs.builder()
            .filter("string")
            .filterType("string")
            .build())
        .scanFrequency("string")
        .build())
    .build());
Copy
registry_scanning_configuration_resource = aws.ecr.RegistryScanningConfiguration("registryScanningConfigurationResource",
    scan_type="string",
    rules=[{
        "repository_filters": [{
            "filter": "string",
            "filter_type": "string",
        }],
        "scan_frequency": "string",
    }])
Copy
const registryScanningConfigurationResource = new aws.ecr.RegistryScanningConfiguration("registryScanningConfigurationResource", {
    scanType: "string",
    rules: [{
        repositoryFilters: [{
            filter: "string",
            filterType: "string",
        }],
        scanFrequency: "string",
    }],
});
Copy
type: aws:ecr:RegistryScanningConfiguration
properties:
    rules:
        - repositoryFilters:
            - filter: string
              filterType: string
          scanFrequency: string
    scanType: string
Copy

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

ScanType This property is required. string
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
Rules List<RegistryScanningConfigurationRule>
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
ScanType This property is required. string
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
Rules []RegistryScanningConfigurationRuleArgs
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scanType This property is required. String
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
rules List<RegistryScanningConfigurationRule>
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scanType This property is required. string
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
rules RegistryScanningConfigurationRule[]
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scan_type This property is required. str
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
rules Sequence[RegistryScanningConfigurationRuleArgs]
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scanType This property is required. String
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
rules List<Property Map>
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RegistryId string
The registry ID the scanning configuration applies to.
Id string
The provider-assigned unique ID for this managed resource.
RegistryId string
The registry ID the scanning configuration applies to.
id String
The provider-assigned unique ID for this managed resource.
registryId String
The registry ID the scanning configuration applies to.
id string
The provider-assigned unique ID for this managed resource.
registryId string
The registry ID the scanning configuration applies to.
id str
The provider-assigned unique ID for this managed resource.
registry_id str
The registry ID the scanning configuration applies to.
id String
The provider-assigned unique ID for this managed resource.
registryId String
The registry ID the scanning configuration applies to.

Look up Existing RegistryScanningConfiguration Resource

Get an existing RegistryScanningConfiguration 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?: RegistryScanningConfigurationState, opts?: CustomResourceOptions): RegistryScanningConfiguration
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        registry_id: Optional[str] = None,
        rules: Optional[Sequence[RegistryScanningConfigurationRuleArgs]] = None,
        scan_type: Optional[str] = None) -> RegistryScanningConfiguration
func GetRegistryScanningConfiguration(ctx *Context, name string, id IDInput, state *RegistryScanningConfigurationState, opts ...ResourceOption) (*RegistryScanningConfiguration, error)
public static RegistryScanningConfiguration Get(string name, Input<string> id, RegistryScanningConfigurationState? state, CustomResourceOptions? opts = null)
public static RegistryScanningConfiguration get(String name, Output<String> id, RegistryScanningConfigurationState state, CustomResourceOptions options)
resources:  _:    type: aws:ecr:RegistryScanningConfiguration    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:
RegistryId string
The registry ID the scanning configuration applies to.
Rules List<RegistryScanningConfigurationRule>
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
ScanType string
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
RegistryId string
The registry ID the scanning configuration applies to.
Rules []RegistryScanningConfigurationRuleArgs
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
ScanType string
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
registryId String
The registry ID the scanning configuration applies to.
rules List<RegistryScanningConfigurationRule>
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scanType String
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
registryId string
The registry ID the scanning configuration applies to.
rules RegistryScanningConfigurationRule[]
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scanType string
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
registry_id str
The registry ID the scanning configuration applies to.
rules Sequence[RegistryScanningConfigurationRuleArgs]
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scan_type str
the scanning type to set for the registry. Can be either ENHANCED or BASIC.
registryId String
The registry ID the scanning configuration applies to.
rules List<Property Map>
One or multiple blocks specifying scanning rules to determine which repository filters are used and at what frequency scanning will occur. See below for schema.
scanType String
the scanning type to set for the registry. Can be either ENHANCED or BASIC.

Supporting Types

RegistryScanningConfigurationRule
, RegistryScanningConfigurationRuleArgs

RepositoryFilters This property is required. List<RegistryScanningConfigurationRuleRepositoryFilter>
One or more repository filter blocks, containing a filter (required string filtering repositories, see pattern regex here) and a filter_type (required string, currently only WILDCARD is supported).
ScanFrequency This property is required. string
The frequency that scans are performed at for a private registry. Can be SCAN_ON_PUSH, CONTINUOUS_SCAN, or MANUAL.
RepositoryFilters This property is required. []RegistryScanningConfigurationRuleRepositoryFilter
One or more repository filter blocks, containing a filter (required string filtering repositories, see pattern regex here) and a filter_type (required string, currently only WILDCARD is supported).
ScanFrequency This property is required. string
The frequency that scans are performed at for a private registry. Can be SCAN_ON_PUSH, CONTINUOUS_SCAN, or MANUAL.
repositoryFilters This property is required. List<RegistryScanningConfigurationRuleRepositoryFilter>
One or more repository filter blocks, containing a filter (required string filtering repositories, see pattern regex here) and a filter_type (required string, currently only WILDCARD is supported).
scanFrequency This property is required. String
The frequency that scans are performed at for a private registry. Can be SCAN_ON_PUSH, CONTINUOUS_SCAN, or MANUAL.
repositoryFilters This property is required. RegistryScanningConfigurationRuleRepositoryFilter[]
One or more repository filter blocks, containing a filter (required string filtering repositories, see pattern regex here) and a filter_type (required string, currently only WILDCARD is supported).
scanFrequency This property is required. string
The frequency that scans are performed at for a private registry. Can be SCAN_ON_PUSH, CONTINUOUS_SCAN, or MANUAL.
repository_filters This property is required. Sequence[RegistryScanningConfigurationRuleRepositoryFilter]
One or more repository filter blocks, containing a filter (required string filtering repositories, see pattern regex here) and a filter_type (required string, currently only WILDCARD is supported).
scan_frequency This property is required. str
The frequency that scans are performed at for a private registry. Can be SCAN_ON_PUSH, CONTINUOUS_SCAN, or MANUAL.
repositoryFilters This property is required. List<Property Map>
One or more repository filter blocks, containing a filter (required string filtering repositories, see pattern regex here) and a filter_type (required string, currently only WILDCARD is supported).
scanFrequency This property is required. String
The frequency that scans are performed at for a private registry. Can be SCAN_ON_PUSH, CONTINUOUS_SCAN, or MANUAL.

RegistryScanningConfigurationRuleRepositoryFilter
, RegistryScanningConfigurationRuleRepositoryFilterArgs

Filter This property is required. string
FilterType This property is required. string
Filter This property is required. string
FilterType This property is required. string
filter This property is required. String
filterType This property is required. String
filter This property is required. string
filterType This property is required. string
filter This property is required. str
filter_type This property is required. str
filter This property is required. String
filterType This property is required. String

Import

Using pulumi import, import ECR Scanning Configurations using the registry_id. For example:

$ pulumi import aws:ecr/registryScanningConfiguration:RegistryScanningConfiguration example 123456789012
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.