1. Packages
  2. AWS Classic
  3. API Docs
  4. ecr
  5. ReplicationConfiguration

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi

aws.ecr.ReplicationConfiguration

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi

    Provides an Elastic Container Registry Replication Configuration.

    Multiple Region Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getCallerIdentity({});
    const exampleRegions = aws.getRegions({});
    const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", {replicationConfiguration: {
        rules: [{
            destinations: [
                {
                    region: exampleRegions.then(exampleRegions => exampleRegions.names?.[0]),
                    registryId: current.then(current => current.accountId),
                },
                {
                    region: exampleRegions.then(exampleRegions => exampleRegions.names?.[1]),
                    registryId: current.then(current => current.accountId),
                },
            ],
        }],
    }});
    
    import pulumi
    import pulumi_aws as aws
    
    current = aws.get_caller_identity()
    example_regions = aws.get_regions()
    example_replication_configuration = aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", replication_configuration=aws.ecr.ReplicationConfigurationReplicationConfigurationArgs(
        rules=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleArgs(
            destinations=[
                aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                    region=example_regions.names[0],
                    registry_id=current.account_id,
                ),
                aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                    region=example_regions.names[1],
                    registry_id=current.account_id,
                ),
            ],
        )],
    ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Aws.GetCallerIdentity.Invoke();
    
        var exampleRegions = Aws.GetRegions.Invoke();
    
        var exampleReplicationConfiguration = new Aws.Ecr.ReplicationConfiguration("exampleReplicationConfiguration", new()
        {
            ReplicationConfigurationDetails = new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationArgs
            {
                Rules = new[]
                {
                    new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleArgs
                    {
                        Destinations = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[0]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[1]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"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 {
    		current, err := aws.GetCallerIdentity(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleRegions, err := aws.GetRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecr.NewReplicationConfiguration(ctx, "exampleReplicationConfiguration", &ecr.ReplicationConfigurationArgs{
    			ReplicationConfiguration: &ecr.ReplicationConfigurationReplicationConfigurationArgs{
    				Rules: ecr.ReplicationConfigurationReplicationConfigurationRuleArray{
    					&ecr.ReplicationConfigurationReplicationConfigurationRuleArgs{
    						Destinations: ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[0]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[1]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    						},
    					},
    				},
    			},
    		})
    		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.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.inputs.GetRegionsArgs;
    import com.pulumi.aws.ecr.ReplicationConfiguration;
    import com.pulumi.aws.ecr.ReplicationConfigurationArgs;
    import com.pulumi.aws.ecr.inputs.ReplicationConfigurationReplicationConfigurationArgs;
    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 current = AwsFunctions.getCallerIdentity();
    
            final var exampleRegions = AwsFunctions.getRegions();
    
            var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()        
                .replicationConfiguration(ReplicationConfigurationReplicationConfigurationArgs.builder()
                    .rules(ReplicationConfigurationReplicationConfigurationRuleArgs.builder()
                        .destinations(                    
                            ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                                .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[0]))
                                .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                                .build(),
                            ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                                .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[1]))
                                .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                                .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleReplicationConfiguration:
        type: aws:ecr:ReplicationConfiguration
        properties:
          replicationConfiguration:
            rules:
              - destinations:
                  - region: ${exampleRegions.names[0]}
                    registryId: ${current.accountId}
                  - region: ${exampleRegions.names[1]}
                    registryId: ${current.accountId}
    variables:
      current:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
      exampleRegions:
        fn::invoke:
          Function: aws:getRegions
          Arguments: {}
    

    Repository Filter Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getCallerIdentity({});
    const exampleRegions = aws.getRegions({});
    const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", {replicationConfiguration: {
        rules: [{
            destinations: [{
                region: exampleRegions.then(exampleRegions => exampleRegions.names?.[0]),
                registryId: current.then(current => current.accountId),
            }],
            repositoryFilters: [{
                filter: "prod-microservice",
                filterType: "PREFIX_MATCH",
            }],
        }],
    }});
    
    import pulumi
    import pulumi_aws as aws
    
    current = aws.get_caller_identity()
    example_regions = aws.get_regions()
    example_replication_configuration = aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", replication_configuration=aws.ecr.ReplicationConfigurationReplicationConfigurationArgs(
        rules=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleArgs(
            destinations=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                region=example_regions.names[0],
                registry_id=current.account_id,
            )],
            repository_filters=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs(
                filter="prod-microservice",
                filter_type="PREFIX_MATCH",
            )],
        )],
    ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Aws.GetCallerIdentity.Invoke();
    
        var exampleRegions = Aws.GetRegions.Invoke();
    
        var exampleReplicationConfiguration = new Aws.Ecr.ReplicationConfiguration("exampleReplicationConfiguration", new()
        {
            ReplicationConfigurationDetails = new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationArgs
            {
                Rules = new[]
                {
                    new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleArgs
                    {
                        Destinations = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[0]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                        },
                        RepositoryFilters = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs
                            {
                                Filter = "prod-microservice",
                                FilterType = "PREFIX_MATCH",
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"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 {
    		current, err := aws.GetCallerIdentity(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleRegions, err := aws.GetRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecr.NewReplicationConfiguration(ctx, "exampleReplicationConfiguration", &ecr.ReplicationConfigurationArgs{
    			ReplicationConfiguration: &ecr.ReplicationConfigurationReplicationConfigurationArgs{
    				Rules: ecr.ReplicationConfigurationReplicationConfigurationRuleArray{
    					&ecr.ReplicationConfigurationReplicationConfigurationRuleArgs{
    						Destinations: ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[0]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    						},
    						RepositoryFilters: ecr.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs{
    								Filter:     pulumi.String("prod-microservice"),
    								FilterType: pulumi.String("PREFIX_MATCH"),
    							},
    						},
    					},
    				},
    			},
    		})
    		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.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.inputs.GetRegionsArgs;
    import com.pulumi.aws.ecr.ReplicationConfiguration;
    import com.pulumi.aws.ecr.ReplicationConfigurationArgs;
    import com.pulumi.aws.ecr.inputs.ReplicationConfigurationReplicationConfigurationArgs;
    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 current = AwsFunctions.getCallerIdentity();
    
            final var exampleRegions = AwsFunctions.getRegions();
    
            var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()        
                .replicationConfiguration(ReplicationConfigurationReplicationConfigurationArgs.builder()
                    .rules(ReplicationConfigurationReplicationConfigurationRuleArgs.builder()
                        .destinations(ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                            .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[0]))
                            .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                            .build())
                        .repositoryFilters(ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs.builder()
                            .filter("prod-microservice")
                            .filterType("PREFIX_MATCH")
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleReplicationConfiguration:
        type: aws:ecr:ReplicationConfiguration
        properties:
          replicationConfiguration:
            rules:
              - destinations:
                  - region: ${exampleRegions.names[0]}
                    registryId: ${current.accountId}
                repositoryFilters:
                  - filter: prod-microservice
                    filterType: PREFIX_MATCH
    variables:
      current:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
      exampleRegions:
        fn::invoke:
          Function: aws:getRegions
          Arguments: {}
    

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Aws.GetCallerIdentity.Invoke();
    
        var exampleRegions = Aws.GetRegions.Invoke();
    
        var exampleReplicationConfiguration = new Aws.Ecr.ReplicationConfiguration("exampleReplicationConfiguration", new()
        {
            ReplicationConfigurationDetails = new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationArgs
            {
                Rules = new[]
                {
                    new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleArgs
                    {
                        Destinations = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[0]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"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 {
    		current, err := aws.GetCallerIdentity(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleRegions, err := aws.GetRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecr.NewReplicationConfiguration(ctx, "exampleReplicationConfiguration", &ecr.ReplicationConfigurationArgs{
    			ReplicationConfiguration: &ecr.ReplicationConfigurationReplicationConfigurationArgs{
    				Rules: ecr.ReplicationConfigurationReplicationConfigurationRuleArray{
    					&ecr.ReplicationConfigurationReplicationConfigurationRuleArgs{
    						Destinations: ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[0]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    						},
    					},
    				},
    			},
    		})
    		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.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.inputs.GetRegionsArgs;
    import com.pulumi.aws.ecr.ReplicationConfiguration;
    import com.pulumi.aws.ecr.ReplicationConfigurationArgs;
    import com.pulumi.aws.ecr.inputs.ReplicationConfigurationReplicationConfigurationArgs;
    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 current = AwsFunctions.getCallerIdentity();
    
            final var exampleRegions = AwsFunctions.getRegions();
    
            var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()        
                .replicationConfiguration(ReplicationConfigurationReplicationConfigurationArgs.builder()
                    .rules(ReplicationConfigurationReplicationConfigurationRuleArgs.builder()
                        .destinations(ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                            .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[0]))
                            .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    current = aws.get_caller_identity()
    example_regions = aws.get_regions()
    example_replication_configuration = aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", replication_configuration=aws.ecr.ReplicationConfigurationReplicationConfigurationArgs(
        rules=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleArgs(
            destinations=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                region=example_regions.names[0],
                registry_id=current.account_id,
            )],
        )],
    ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getCallerIdentity({});
    const exampleRegions = aws.getRegions({});
    const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", {replicationConfiguration: {
        rules: [{
            destinations: [{
                region: exampleRegions.then(exampleRegions => exampleRegions.names?.[0]),
                registryId: current.then(current => current.accountId),
            }],
        }],
    }});
    
    resources:
      exampleReplicationConfiguration:
        type: aws:ecr:ReplicationConfiguration
        properties:
          replicationConfiguration:
            rules:
              - destinations:
                  - region: ${exampleRegions.names[0]}
                    registryId: ${current.accountId}
    variables:
      current:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
      exampleRegions:
        fn::invoke:
          Function: aws:getRegions
          Arguments: {}
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Aws.GetCallerIdentity.Invoke();
    
        var exampleRegions = Aws.GetRegions.Invoke();
    
        var exampleReplicationConfiguration = new Aws.Ecr.ReplicationConfiguration("exampleReplicationConfiguration", new()
        {
            ReplicationConfigurationDetails = new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationArgs
            {
                Rules = new[]
                {
                    new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleArgs
                    {
                        Destinations = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[0]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[1]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"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 {
    		current, err := aws.GetCallerIdentity(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleRegions, err := aws.GetRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecr.NewReplicationConfiguration(ctx, "exampleReplicationConfiguration", &ecr.ReplicationConfigurationArgs{
    			ReplicationConfiguration: &ecr.ReplicationConfigurationReplicationConfigurationArgs{
    				Rules: ecr.ReplicationConfigurationReplicationConfigurationRuleArray{
    					&ecr.ReplicationConfigurationReplicationConfigurationRuleArgs{
    						Destinations: ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[0]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[1]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    						},
    					},
    				},
    			},
    		})
    		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.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.inputs.GetRegionsArgs;
    import com.pulumi.aws.ecr.ReplicationConfiguration;
    import com.pulumi.aws.ecr.ReplicationConfigurationArgs;
    import com.pulumi.aws.ecr.inputs.ReplicationConfigurationReplicationConfigurationArgs;
    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 current = AwsFunctions.getCallerIdentity();
    
            final var exampleRegions = AwsFunctions.getRegions();
    
            var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()        
                .replicationConfiguration(ReplicationConfigurationReplicationConfigurationArgs.builder()
                    .rules(ReplicationConfigurationReplicationConfigurationRuleArgs.builder()
                        .destinations(                    
                            ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                                .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[0]))
                                .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                                .build(),
                            ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                                .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[1]))
                                .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                                .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    current = aws.get_caller_identity()
    example_regions = aws.get_regions()
    example_replication_configuration = aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", replication_configuration=aws.ecr.ReplicationConfigurationReplicationConfigurationArgs(
        rules=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleArgs(
            destinations=[
                aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                    region=example_regions.names[0],
                    registry_id=current.account_id,
                ),
                aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                    region=example_regions.names[1],
                    registry_id=current.account_id,
                ),
            ],
        )],
    ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getCallerIdentity({});
    const exampleRegions = aws.getRegions({});
    const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", {replicationConfiguration: {
        rules: [{
            destinations: [
                {
                    region: exampleRegions.then(exampleRegions => exampleRegions.names?.[0]),
                    registryId: current.then(current => current.accountId),
                },
                {
                    region: exampleRegions.then(exampleRegions => exampleRegions.names?.[1]),
                    registryId: current.then(current => current.accountId),
                },
            ],
        }],
    }});
    
    resources:
      exampleReplicationConfiguration:
        type: aws:ecr:ReplicationConfiguration
        properties:
          replicationConfiguration:
            rules:
              - destinations:
                  - region: ${exampleRegions.names[0]}
                    registryId: ${current.accountId}
                  - region: ${exampleRegions.names[1]}
                    registryId: ${current.accountId}
    variables:
      current:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
      exampleRegions:
        fn::invoke:
          Function: aws:getRegions
          Arguments: {}
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var current = Aws.GetCallerIdentity.Invoke();
    
        var exampleRegions = Aws.GetRegions.Invoke();
    
        var exampleReplicationConfiguration = new Aws.Ecr.ReplicationConfiguration("exampleReplicationConfiguration", new()
        {
            ReplicationConfigurationDetails = new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationArgs
            {
                Rules = new[]
                {
                    new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleArgs
                    {
                        Destinations = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs
                            {
                                Region = exampleRegions.Apply(getRegionsResult => getRegionsResult.Names[0]),
                                RegistryId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
                            },
                        },
                        RepositoryFilters = new[]
                        {
                            new Aws.Ecr.Inputs.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs
                            {
                                Filter = "prod-microservice",
                                FilterType = "PREFIX_MATCH",
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    	"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 {
    		current, err := aws.GetCallerIdentity(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleRegions, err := aws.GetRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecr.NewReplicationConfiguration(ctx, "exampleReplicationConfiguration", &ecr.ReplicationConfigurationArgs{
    			ReplicationConfiguration: &ecr.ReplicationConfigurationReplicationConfigurationArgs{
    				Rules: ecr.ReplicationConfigurationReplicationConfigurationRuleArray{
    					&ecr.ReplicationConfigurationReplicationConfigurationRuleArgs{
    						Destinations: ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs{
    								Region:     *pulumi.String(exampleRegions.Names[0]),
    								RegistryId: *pulumi.String(current.AccountId),
    							},
    						},
    						RepositoryFilters: ecr.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArray{
    							&ecr.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs{
    								Filter:     pulumi.String("prod-microservice"),
    								FilterType: pulumi.String("PREFIX_MATCH"),
    							},
    						},
    					},
    				},
    			},
    		})
    		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.AwsFunctions;
    import com.pulumi.aws.inputs.GetCallerIdentityArgs;
    import com.pulumi.aws.inputs.GetRegionsArgs;
    import com.pulumi.aws.ecr.ReplicationConfiguration;
    import com.pulumi.aws.ecr.ReplicationConfigurationArgs;
    import com.pulumi.aws.ecr.inputs.ReplicationConfigurationReplicationConfigurationArgs;
    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 current = AwsFunctions.getCallerIdentity();
    
            final var exampleRegions = AwsFunctions.getRegions();
    
            var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()        
                .replicationConfiguration(ReplicationConfigurationReplicationConfigurationArgs.builder()
                    .rules(ReplicationConfigurationReplicationConfigurationRuleArgs.builder()
                        .destinations(ReplicationConfigurationReplicationConfigurationRuleDestinationArgs.builder()
                            .region(exampleRegions.applyValue(getRegionsResult -> getRegionsResult.names()[0]))
                            .registryId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                            .build())
                        .repositoryFilters(ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs.builder()
                            .filter("prod-microservice")
                            .filterType("PREFIX_MATCH")
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    current = aws.get_caller_identity()
    example_regions = aws.get_regions()
    example_replication_configuration = aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", replication_configuration=aws.ecr.ReplicationConfigurationReplicationConfigurationArgs(
        rules=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleArgs(
            destinations=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleDestinationArgs(
                region=example_regions.names[0],
                registry_id=current.account_id,
            )],
            repository_filters=[aws.ecr.ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs(
                filter="prod-microservice",
                filter_type="PREFIX_MATCH",
            )],
        )],
    ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const current = aws.getCallerIdentity({});
    const exampleRegions = aws.getRegions({});
    const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("exampleReplicationConfiguration", {replicationConfiguration: {
        rules: [{
            destinations: [{
                region: exampleRegions.then(exampleRegions => exampleRegions.names?.[0]),
                registryId: current.then(current => current.accountId),
            }],
            repositoryFilters: [{
                filter: "prod-microservice",
                filterType: "PREFIX_MATCH",
            }],
        }],
    }});
    
    resources:
      exampleReplicationConfiguration:
        type: aws:ecr:ReplicationConfiguration
        properties:
          replicationConfiguration:
            rules:
              - destinations:
                  - region: ${exampleRegions.names[0]}
                    registryId: ${current.accountId}
                repositoryFilters:
                  - filter: prod-microservice
                    filterType: PREFIX_MATCH
    variables:
      current:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
      exampleRegions:
        fn::invoke:
          Function: aws:getRegions
          Arguments: {}
    

    Create ReplicationConfiguration Resource

    new ReplicationConfiguration(name: string, args?: ReplicationConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicationConfiguration(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 replication_configuration: Optional[ReplicationConfigurationReplicationConfigurationArgs] = None)
    @overload
    def ReplicationConfiguration(resource_name: str,
                                 args: Optional[ReplicationConfigurationArgs] = None,
                                 opts: Optional[ResourceOptions] = None)
    func NewReplicationConfiguration(ctx *Context, name string, args *ReplicationConfigurationArgs, opts ...ResourceOption) (*ReplicationConfiguration, error)
    public ReplicationConfiguration(string name, ReplicationConfigurationArgs? args = null, CustomResourceOptions? opts = null)
    public ReplicationConfiguration(String name, ReplicationConfigurationArgs args)
    public ReplicationConfiguration(String name, ReplicationConfigurationArgs args, CustomResourceOptions options)
    
    type: aws:ecr:ReplicationConfiguration
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ReplicationConfigurationArgs
    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 ReplicationConfigurationArgs
    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 ReplicationConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReplicationConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReplicationConfigurationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ReplicationConfiguration Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ReplicationConfiguration resource accepts the following input properties:

    ReplicationConfigurationDetails ReplicationConfigurationReplicationConfiguration
    Replication configuration for a registry. See Replication Configuration.
    ReplicationConfiguration ReplicationConfigurationReplicationConfigurationArgs
    Replication configuration for a registry. See Replication Configuration.
    replicationConfiguration ReplicationConfigurationReplicationConfiguration
    Replication configuration for a registry. See Replication Configuration.
    replicationConfiguration ReplicationConfigurationReplicationConfiguration
    Replication configuration for a registry. See Replication Configuration.
    replication_configuration ReplicationConfigurationReplicationConfigurationArgs
    Replication configuration for a registry. See Replication Configuration.
    replicationConfiguration Property Map
    Replication configuration for a registry. See Replication Configuration.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    RegistryId string
    The account ID of the destination registry to replicate to.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegistryId string
    The account ID of the destination registry to replicate to.
    id String
    The provider-assigned unique ID for this managed resource.
    registryId String
    The account ID of the destination registry to replicate to.
    id string
    The provider-assigned unique ID for this managed resource.
    registryId string
    The account ID of the destination registry to replicate to.
    id str
    The provider-assigned unique ID for this managed resource.
    registry_id str
    The account ID of the destination registry to replicate to.
    id String
    The provider-assigned unique ID for this managed resource.
    registryId String
    The account ID of the destination registry to replicate to.

    Look up Existing ReplicationConfiguration Resource

    Get an existing ReplicationConfiguration 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?: ReplicationConfigurationState, opts?: CustomResourceOptions): ReplicationConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            registry_id: Optional[str] = None,
            replication_configuration: Optional[ReplicationConfigurationReplicationConfigurationArgs] = None) -> ReplicationConfiguration
    func GetReplicationConfiguration(ctx *Context, name string, id IDInput, state *ReplicationConfigurationState, opts ...ResourceOption) (*ReplicationConfiguration, error)
    public static ReplicationConfiguration Get(string name, Input<string> id, ReplicationConfigurationState? state, CustomResourceOptions? opts = null)
    public static ReplicationConfiguration get(String name, Output<String> id, ReplicationConfigurationState 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.
    The following state arguments are supported:
    RegistryId string
    The account ID of the destination registry to replicate to.
    ReplicationConfigurationDetails ReplicationConfigurationReplicationConfiguration
    Replication configuration for a registry. See Replication Configuration.
    RegistryId string
    The account ID of the destination registry to replicate to.
    ReplicationConfiguration ReplicationConfigurationReplicationConfigurationArgs
    Replication configuration for a registry. See Replication Configuration.
    registryId String
    The account ID of the destination registry to replicate to.
    replicationConfiguration ReplicationConfigurationReplicationConfiguration
    Replication configuration for a registry. See Replication Configuration.
    registryId string
    The account ID of the destination registry to replicate to.
    replicationConfiguration ReplicationConfigurationReplicationConfiguration
    Replication configuration for a registry. See Replication Configuration.
    registry_id str
    The account ID of the destination registry to replicate to.
    replication_configuration ReplicationConfigurationReplicationConfigurationArgs
    Replication configuration for a registry. See Replication Configuration.
    registryId String
    The account ID of the destination registry to replicate to.
    replicationConfiguration Property Map
    Replication configuration for a registry. See Replication Configuration.

    Supporting Types

    ReplicationConfigurationReplicationConfiguration, ReplicationConfigurationReplicationConfigurationArgs

    Rules List<ReplicationConfigurationReplicationConfigurationRule>
    The replication rules for a replication configuration. A maximum of 10 are allowed per replication_configuration. See Rule
    Rules []ReplicationConfigurationReplicationConfigurationRule
    The replication rules for a replication configuration. A maximum of 10 are allowed per replication_configuration. See Rule
    rules List<ReplicationConfigurationReplicationConfigurationRule>
    The replication rules for a replication configuration. A maximum of 10 are allowed per replication_configuration. See Rule
    rules ReplicationConfigurationReplicationConfigurationRule[]
    The replication rules for a replication configuration. A maximum of 10 are allowed per replication_configuration. See Rule
    rules Sequence[ReplicationConfigurationReplicationConfigurationRule]
    The replication rules for a replication configuration. A maximum of 10 are allowed per replication_configuration. See Rule
    rules List<Property Map>
    The replication rules for a replication configuration. A maximum of 10 are allowed per replication_configuration. See Rule

    ReplicationConfigurationReplicationConfigurationRule, ReplicationConfigurationReplicationConfigurationRuleArgs

    Destinations List<ReplicationConfigurationReplicationConfigurationRuleDestination>
    the details of a replication destination. A maximum of 25 are allowed per rule. See Destination.
    RepositoryFilters List<ReplicationConfigurationReplicationConfigurationRuleRepositoryFilter>
    filters for a replication rule. See Repository Filter.
    Destinations []ReplicationConfigurationReplicationConfigurationRuleDestination
    the details of a replication destination. A maximum of 25 are allowed per rule. See Destination.
    RepositoryFilters []ReplicationConfigurationReplicationConfigurationRuleRepositoryFilter
    filters for a replication rule. See Repository Filter.
    destinations List<ReplicationConfigurationReplicationConfigurationRuleDestination>
    the details of a replication destination. A maximum of 25 are allowed per rule. See Destination.
    repositoryFilters List<ReplicationConfigurationReplicationConfigurationRuleRepositoryFilter>
    filters for a replication rule. See Repository Filter.
    destinations ReplicationConfigurationReplicationConfigurationRuleDestination[]
    the details of a replication destination. A maximum of 25 are allowed per rule. See Destination.
    repositoryFilters ReplicationConfigurationReplicationConfigurationRuleRepositoryFilter[]
    filters for a replication rule. See Repository Filter.
    destinations Sequence[ReplicationConfigurationReplicationConfigurationRuleDestination]
    the details of a replication destination. A maximum of 25 are allowed per rule. See Destination.
    repository_filters Sequence[ReplicationConfigurationReplicationConfigurationRuleRepositoryFilter]
    filters for a replication rule. See Repository Filter.
    destinations List<Property Map>
    the details of a replication destination. A maximum of 25 are allowed per rule. See Destination.
    repositoryFilters List<Property Map>
    filters for a replication rule. See Repository Filter.

    ReplicationConfigurationReplicationConfigurationRuleDestination, ReplicationConfigurationReplicationConfigurationRuleDestinationArgs

    Region string
    A Region to replicate to.
    RegistryId string
    The account ID of the destination registry to replicate to.
    Region string
    A Region to replicate to.
    RegistryId string
    The account ID of the destination registry to replicate to.
    region String
    A Region to replicate to.
    registryId String
    The account ID of the destination registry to replicate to.
    region string
    A Region to replicate to.
    registryId string
    The account ID of the destination registry to replicate to.
    region str
    A Region to replicate to.
    registry_id str
    The account ID of the destination registry to replicate to.
    region String
    A Region to replicate to.
    registryId String
    The account ID of the destination registry to replicate to.

    ReplicationConfigurationReplicationConfigurationRuleRepositoryFilter, ReplicationConfigurationReplicationConfigurationRuleRepositoryFilterArgs

    Filter string
    The repository filter details.
    FilterType string
    The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.
    Filter string
    The repository filter details.
    FilterType string
    The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.
    filter String
    The repository filter details.
    filterType String
    The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.
    filter string
    The repository filter details.
    filterType string
    The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.
    filter str
    The repository filter details.
    filter_type str
    The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.
    filter String
    The repository filter details.
    filterType String
    The repository filter type. The only supported value is PREFIX_MATCH, which is a repository name prefix specified with the filter parameter.

    Import

    Using pulumi import, import ECR Replication Configuration using the registry_id. For example:

     $ pulumi import aws:ecr/replicationConfiguration:ReplicationConfiguration service 012345678912
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.24.0 published on Tuesday, Feb 27, 2024 by Pulumi