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",
}],
}],
});
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",
}],
}])
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
})
}
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",
},
},
},
},
});
});
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());
}
}
resources:
configuration:
type: aws:ecr:RegistryScanningConfiguration
properties:
scanType: ENHANCED
rules:
- scanFrequency: CONTINUOUS_SCAN
repositoryFilters:
- filter: example
filterType: WILDCARD
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",
}],
},
],
});
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",
}],
},
])
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
})
}
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",
},
},
},
},
});
});
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());
}
}
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
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 string
- The unique name of the resource.
- args RegistryScanningConfigurationArgs
- 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 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 string
- The unique name of the resource.
- args RegistryScanningConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegistryScanningConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
},
},
});
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"),
},
},
})
var registryScanningConfigurationResource = new RegistryScanningConfiguration("registryScanningConfigurationResource", RegistryScanningConfigurationArgs.builder()
.scanType("string")
.rules(RegistryScanningConfigurationRuleArgs.builder()
.repositoryFilters(RegistryScanningConfigurationRuleRepositoryFilterArgs.builder()
.filter("string")
.filterType("string")
.build())
.scanFrequency("string")
.build())
.build());
registry_scanning_configuration_resource = aws.ecr.RegistryScanningConfiguration("registryScanningConfigurationResource",
scan_type="string",
rules=[{
"repository_filters": [{
"filter": "string",
"filter_type": "string",
}],
"scan_frequency": "string",
}])
const registryScanningConfigurationResource = new aws.ecr.RegistryScanningConfiguration("registryScanningConfigurationResource", {
scanType: "string",
rules: [{
repositoryFilters: [{
filter: "string",
filterType: "string",
}],
scanFrequency: "string",
}],
});
type: aws:ecr:RegistryScanningConfiguration
properties:
rules:
- repositoryFilters:
- filter: string
filterType: string
scanFrequency: string
scanType: string
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:
- Scan
Type string - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
. - Rules
List<Registry
Scanning Configuration Rule> - 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 string - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
. - Rules
[]Registry
Scanning Configuration Rule Args - 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 String - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
. - rules
List<Registry
Scanning Configuration Rule> - 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 string - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
. - rules
Registry
Scanning Configuration Rule[] - 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
orBASIC
. - rules
Sequence[Registry
Scanning Configuration Rule Args] - 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 String - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
. - 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.
- Registry
Id string - The registry ID the scanning configuration applies to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Registry
Id string - The registry ID the scanning configuration applies to.
- id String
- The provider-assigned unique ID for this managed resource.
- registry
Id String - The registry ID the scanning configuration applies to.
- id string
- The provider-assigned unique ID for this managed resource.
- registry
Id 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.
- registry
Id 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)
Resource lookup is not supported in YAML
- 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.
- Registry
Id string - The registry ID the scanning configuration applies to.
- Rules
List<Registry
Scanning Configuration Rule> - 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 string - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
.
- Registry
Id string - The registry ID the scanning configuration applies to.
- Rules
[]Registry
Scanning Configuration Rule Args - 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 string - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
.
- registry
Id String - The registry ID the scanning configuration applies to.
- rules
List<Registry
Scanning Configuration Rule> - 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 String - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
.
- registry
Id string - The registry ID the scanning configuration applies to.
- rules
Registry
Scanning Configuration Rule[] - 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 string - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
.
- registry_
id str - The registry ID the scanning configuration applies to.
- rules
Sequence[Registry
Scanning Configuration Rule Args] - 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
orBASIC
.
- registry
Id 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.
- scan
Type String - the scanning type to set for the registry. Can be either
ENHANCED
orBASIC
.
Supporting Types
RegistryScanningConfigurationRule, RegistryScanningConfigurationRuleArgs
- Repository
Filters List<RegistryScanning Configuration Rule Repository Filter> - One or more repository filter blocks, containing a
filter
(required string filtering repositories, see pattern regex here) and afilter_type
(required string, currently onlyWILDCARD
is supported). - Scan
Frequency string - The frequency that scans are performed at for a private registry. Can be
SCAN_ON_PUSH
,CONTINUOUS_SCAN
, orMANUAL
.
- Repository
Filters []RegistryScanning Configuration Rule Repository Filter - One or more repository filter blocks, containing a
filter
(required string filtering repositories, see pattern regex here) and afilter_type
(required string, currently onlyWILDCARD
is supported). - Scan
Frequency string - The frequency that scans are performed at for a private registry. Can be
SCAN_ON_PUSH
,CONTINUOUS_SCAN
, orMANUAL
.
- repository
Filters List<RegistryScanning Configuration Rule Repository Filter> - One or more repository filter blocks, containing a
filter
(required string filtering repositories, see pattern regex here) and afilter_type
(required string, currently onlyWILDCARD
is supported). - scan
Frequency String - The frequency that scans are performed at for a private registry. Can be
SCAN_ON_PUSH
,CONTINUOUS_SCAN
, orMANUAL
.
- repository
Filters RegistryScanning Configuration Rule Repository Filter[] - One or more repository filter blocks, containing a
filter
(required string filtering repositories, see pattern regex here) and afilter_type
(required string, currently onlyWILDCARD
is supported). - scan
Frequency string - The frequency that scans are performed at for a private registry. Can be
SCAN_ON_PUSH
,CONTINUOUS_SCAN
, orMANUAL
.
- repository_
filters Sequence[RegistryScanning Configuration Rule Repository Filter] - One or more repository filter blocks, containing a
filter
(required string filtering repositories, see pattern regex here) and afilter_type
(required string, currently onlyWILDCARD
is supported). - scan_
frequency str - The frequency that scans are performed at for a private registry. Can be
SCAN_ON_PUSH
,CONTINUOUS_SCAN
, orMANUAL
.
- repository
Filters List<Property Map> - One or more repository filter blocks, containing a
filter
(required string filtering repositories, see pattern regex here) and afilter_type
(required string, currently onlyWILDCARD
is supported). - scan
Frequency String - The frequency that scans are performed at for a private registry. Can be
SCAN_ON_PUSH
,CONTINUOUS_SCAN
, orMANUAL
.
RegistryScanningConfigurationRuleRepositoryFilter, RegistryScanningConfigurationRuleRepositoryFilterArgs
- Filter string
- Filter
Type string
- Filter string
- Filter
Type string
- filter String
- filter
Type String
- filter string
- filter
Type string
- filter str
- filter_
type str
- filter String
- filter
Type String
Import
Using pulumi import
, import ECR Scanning Configurations using the registry_id
. For example:
$ pulumi import aws:ecr/registryScanningConfiguration:RegistryScanningConfiguration example 123456789012
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.