@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 4.83 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReplicationConfiguration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Elastic Container Registry Replication Configuration.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getCallerIdentity({});
* const example = aws.getRegions({});
* const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("example", {replicationConfiguration: {
* rules: [{
* destinations: [{
* region: example.then(example => example.names?.[0]),
* registryId: current.then(current => current.accountId),
* }],
* }],
* }});
* ```
*
* ## Multiple Region Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getCallerIdentity({});
* const example = aws.getRegions({});
* const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("example", {replicationConfiguration: {
* rules: [{
* destinations: [
* {
* region: example.then(example => example.names?.[0]),
* registryId: current.then(current => current.accountId),
* },
* {
* region: example.then(example => example.names?.[1]),
* registryId: current.then(current => current.accountId),
* },
* ],
* }],
* }});
* ```
*
* ## Repository Filter Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getCallerIdentity({});
* const example = aws.getRegions({});
* const exampleReplicationConfiguration = new aws.ecr.ReplicationConfiguration("example", {replicationConfiguration: {
* rules: [{
* destinations: [{
* region: example.then(example => example.names?.[0]),
* registryId: current.then(current => current.accountId),
* }],
* repositoryFilters: [{
* filter: "prod-microservice",
* filterType: "PREFIX_MATCH",
* }],
* }],
* }});
* ```
*
* ## Import
*
* Using `pulumi import`, import ECR Replication Configuration using the `registry_id`. For example:
*
* ```sh
* $ pulumi import aws:ecr/replicationConfiguration:ReplicationConfiguration service 012345678912
* ```
*/
class ReplicationConfiguration extends pulumi.CustomResource {
/**
* Get an existing ReplicationConfiguration resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ReplicationConfiguration(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ReplicationConfiguration. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ReplicationConfiguration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["region"] = state?.region;
resourceInputs["registryId"] = state?.registryId;
resourceInputs["replicationConfiguration"] = state?.replicationConfiguration;
}
else {
const args = argsOrState;
resourceInputs["region"] = args?.region;
resourceInputs["replicationConfiguration"] = args?.replicationConfiguration;
resourceInputs["registryId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ReplicationConfiguration.__pulumiType, name, resourceInputs, opts);
}
}
exports.ReplicationConfiguration = ReplicationConfiguration;
/** @internal */
ReplicationConfiguration.__pulumiType = 'aws:ecr/replicationConfiguration:ReplicationConfiguration';
//# sourceMappingURL=replicationConfiguration.js.map
;