1. Packages
  2. Artifactory
  3. API Docs
  4. ReplicationConfig
artifactory v6.6.1 published on Thursday, Apr 18, 2024 by Pulumi

artifactory.ReplicationConfig

Explore with Pulumi AI

artifactory logo
artifactory v6.6.1 published on Thursday, Apr 18, 2024 by Pulumi

    This resource is deprecated in favor of artifactory.PushReplication resource.

    Provides an Artifactory replication config resource. This can be used to create and manage Artifactory replications.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as artifactory from "@pulumi/artifactory";
    
    // Create a replication between two artifactory local repositories
    const providerTestSource = new artifactory.LocalMavenRepository("providerTestSource", {key: "provider_test_source"});
    const providerTestDest = new artifactory.LocalMavenRepository("providerTestDest", {key: "provider_test_dest"});
    const foo_rep = new artifactory.ReplicationConfig("foo-rep", {
        cronExp: "0 0 * * * ?",
        enableEventReplication: true,
        replications: [{
            password: "$var.artifactory_password",
            url: "$var.artifactory_url",
            username: "$var.artifactory_username",
        }],
        repoKey: providerTestSource.key,
    });
    
    import pulumi
    import pulumi_artifactory as artifactory
    
    # Create a replication between two artifactory local repositories
    provider_test_source = artifactory.LocalMavenRepository("providerTestSource", key="provider_test_source")
    provider_test_dest = artifactory.LocalMavenRepository("providerTestDest", key="provider_test_dest")
    foo_rep = artifactory.ReplicationConfig("foo-rep",
        cron_exp="0 0 * * * ?",
        enable_event_replication=True,
        replications=[artifactory.ReplicationConfigReplicationArgs(
            password="$var.artifactory_password",
            url="$var.artifactory_url",
            username="$var.artifactory_username",
        )],
        repo_key=provider_test_source.key)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a replication between two artifactory local repositories
    		providerTestSource, err := artifactory.NewLocalMavenRepository(ctx, "providerTestSource", &artifactory.LocalMavenRepositoryArgs{
    			Key: pulumi.String("provider_test_source"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = artifactory.NewLocalMavenRepository(ctx, "providerTestDest", &artifactory.LocalMavenRepositoryArgs{
    			Key: pulumi.String("provider_test_dest"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = artifactory.NewReplicationConfig(ctx, "foo-rep", &artifactory.ReplicationConfigArgs{
    			CronExp:                pulumi.String("0 0 * * * ?"),
    			EnableEventReplication: pulumi.Bool(true),
    			Replications: artifactory.ReplicationConfigReplicationArray{
    				&artifactory.ReplicationConfigReplicationArgs{
    					Password: pulumi.String("$var.artifactory_password"),
    					Url:      pulumi.String("$var.artifactory_url"),
    					Username: pulumi.String("$var.artifactory_username"),
    				},
    			},
    			RepoKey: providerTestSource.Key,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Artifactory = Pulumi.Artifactory;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a replication between two artifactory local repositories
        var providerTestSource = new Artifactory.LocalMavenRepository("providerTestSource", new()
        {
            Key = "provider_test_source",
        });
    
        var providerTestDest = new Artifactory.LocalMavenRepository("providerTestDest", new()
        {
            Key = "provider_test_dest",
        });
    
        var foo_rep = new Artifactory.ReplicationConfig("foo-rep", new()
        {
            CronExp = "0 0 * * * ?",
            EnableEventReplication = true,
            Replications = new[]
            {
                new Artifactory.Inputs.ReplicationConfigReplicationArgs
                {
                    Password = "$var.artifactory_password",
                    Url = "$var.artifactory_url",
                    Username = "$var.artifactory_username",
                },
            },
            RepoKey = providerTestSource.Key,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.artifactory.LocalMavenRepository;
    import com.pulumi.artifactory.LocalMavenRepositoryArgs;
    import com.pulumi.artifactory.ReplicationConfig;
    import com.pulumi.artifactory.ReplicationConfigArgs;
    import com.pulumi.artifactory.inputs.ReplicationConfigReplicationArgs;
    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) {
            // Create a replication between two artifactory local repositories
            var providerTestSource = new LocalMavenRepository("providerTestSource", LocalMavenRepositoryArgs.builder()        
                .key("provider_test_source")
                .build());
    
            var providerTestDest = new LocalMavenRepository("providerTestDest", LocalMavenRepositoryArgs.builder()        
                .key("provider_test_dest")
                .build());
    
            var foo_rep = new ReplicationConfig("foo-rep", ReplicationConfigArgs.builder()        
                .cronExp("0 0 * * * ?")
                .enableEventReplication(true)
                .replications(ReplicationConfigReplicationArgs.builder()
                    .password("$var.artifactory_password")
                    .url("$var.artifactory_url")
                    .username("$var.artifactory_username")
                    .build())
                .repoKey(providerTestSource.key())
                .build());
    
        }
    }
    
    resources:
      # Create a replication between two artifactory local repositories
      providerTestSource:
        type: artifactory:LocalMavenRepository
        properties:
          key: provider_test_source
      providerTestDest:
        type: artifactory:LocalMavenRepository
        properties:
          key: provider_test_dest
      foo-rep:
        type: artifactory:ReplicationConfig
        properties:
          cronExp: 0 0 * * * ?
          enableEventReplication: true
          replications:
            - password: $var.artifactory_password
              url: $var.artifactory_url
              username: $var.artifactory_username
          repoKey: ${providerTestSource.key}
    

    Create ReplicationConfig Resource

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

    Constructor syntax

    new ReplicationConfig(name: string, args: ReplicationConfigArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicationConfig(resource_name: str,
                          args: ReplicationConfigArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReplicationConfig(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          cron_exp: Optional[str] = None,
                          repo_key: Optional[str] = None,
                          enable_event_replication: Optional[bool] = None,
                          replications: Optional[Sequence[ReplicationConfigReplicationArgs]] = None)
    func NewReplicationConfig(ctx *Context, name string, args ReplicationConfigArgs, opts ...ResourceOption) (*ReplicationConfig, error)
    public ReplicationConfig(string name, ReplicationConfigArgs args, CustomResourceOptions? opts = null)
    public ReplicationConfig(String name, ReplicationConfigArgs args)
    public ReplicationConfig(String name, ReplicationConfigArgs args, CustomResourceOptions options)
    
    type: artifactory:ReplicationConfig
    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 ReplicationConfigArgs
    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 ReplicationConfigArgs
    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 ReplicationConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReplicationConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReplicationConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var replicationConfigResource = new Artifactory.ReplicationConfig("replicationConfigResource", new()
    {
        CronExp = "string",
        RepoKey = "string",
        EnableEventReplication = false,
        Replications = new[]
        {
            new Artifactory.Inputs.ReplicationConfigReplicationArgs
            {
                Enabled = false,
                Password = "string",
                PathPrefix = "string",
                Proxy = "string",
                SocketTimeoutMillis = 0,
                SyncDeletes = false,
                SyncProperties = false,
                SyncStatistics = false,
                Url = "string",
                Username = "string",
            },
        },
    });
    
    example, err := artifactory.NewReplicationConfig(ctx, "replicationConfigResource", &artifactory.ReplicationConfigArgs{
    	CronExp:                pulumi.String("string"),
    	RepoKey:                pulumi.String("string"),
    	EnableEventReplication: pulumi.Bool(false),
    	Replications: artifactory.ReplicationConfigReplicationArray{
    		&artifactory.ReplicationConfigReplicationArgs{
    			Enabled:             pulumi.Bool(false),
    			Password:            pulumi.String("string"),
    			PathPrefix:          pulumi.String("string"),
    			Proxy:               pulumi.String("string"),
    			SocketTimeoutMillis: pulumi.Int(0),
    			SyncDeletes:         pulumi.Bool(false),
    			SyncProperties:      pulumi.Bool(false),
    			SyncStatistics:      pulumi.Bool(false),
    			Url:                 pulumi.String("string"),
    			Username:            pulumi.String("string"),
    		},
    	},
    })
    
    var replicationConfigResource = new ReplicationConfig("replicationConfigResource", ReplicationConfigArgs.builder()        
        .cronExp("string")
        .repoKey("string")
        .enableEventReplication(false)
        .replications(ReplicationConfigReplicationArgs.builder()
            .enabled(false)
            .password("string")
            .pathPrefix("string")
            .proxy("string")
            .socketTimeoutMillis(0)
            .syncDeletes(false)
            .syncProperties(false)
            .syncStatistics(false)
            .url("string")
            .username("string")
            .build())
        .build());
    
    replication_config_resource = artifactory.ReplicationConfig("replicationConfigResource",
        cron_exp="string",
        repo_key="string",
        enable_event_replication=False,
        replications=[artifactory.ReplicationConfigReplicationArgs(
            enabled=False,
            password="string",
            path_prefix="string",
            proxy="string",
            socket_timeout_millis=0,
            sync_deletes=False,
            sync_properties=False,
            sync_statistics=False,
            url="string",
            username="string",
        )])
    
    const replicationConfigResource = new artifactory.ReplicationConfig("replicationConfigResource", {
        cronExp: "string",
        repoKey: "string",
        enableEventReplication: false,
        replications: [{
            enabled: false,
            password: "string",
            pathPrefix: "string",
            proxy: "string",
            socketTimeoutMillis: 0,
            syncDeletes: false,
            syncProperties: false,
            syncStatistics: false,
            url: "string",
            username: "string",
        }],
    });
    
    type: artifactory:ReplicationConfig
    properties:
        cronExp: string
        enableEventReplication: false
        replications:
            - enabled: false
              password: string
              pathPrefix: string
              proxy: string
              socketTimeoutMillis: 0
              syncDeletes: false
              syncProperties: false
              syncStatistics: false
              url: string
              username: string
        repoKey: string
    

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

    CronExp string
    Cron expression to control the operation frequency.
    RepoKey string
    EnableEventReplication bool
    Replications List<ReplicationConfigReplication>
    CronExp string
    Cron expression to control the operation frequency.
    RepoKey string
    EnableEventReplication bool
    Replications []ReplicationConfigReplicationArgs
    cronExp String
    Cron expression to control the operation frequency.
    repoKey String
    enableEventReplication Boolean
    replications List<ReplicationConfigReplication>
    cronExp string
    Cron expression to control the operation frequency.
    repoKey string
    enableEventReplication boolean
    replications ReplicationConfigReplication[]
    cron_exp str
    Cron expression to control the operation frequency.
    repo_key str
    enable_event_replication bool
    replications Sequence[ReplicationConfigReplicationArgs]
    cronExp String
    Cron expression to control the operation frequency.
    repoKey String
    enableEventReplication Boolean
    replications List<Property Map>

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ReplicationConfig Resource

    Get an existing ReplicationConfig 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?: ReplicationConfigState, opts?: CustomResourceOptions): ReplicationConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cron_exp: Optional[str] = None,
            enable_event_replication: Optional[bool] = None,
            replications: Optional[Sequence[ReplicationConfigReplicationArgs]] = None,
            repo_key: Optional[str] = None) -> ReplicationConfig
    func GetReplicationConfig(ctx *Context, name string, id IDInput, state *ReplicationConfigState, opts ...ResourceOption) (*ReplicationConfig, error)
    public static ReplicationConfig Get(string name, Input<string> id, ReplicationConfigState? state, CustomResourceOptions? opts = null)
    public static ReplicationConfig get(String name, Output<String> id, ReplicationConfigState 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:
    CronExp string
    Cron expression to control the operation frequency.
    EnableEventReplication bool
    Replications List<ReplicationConfigReplication>
    RepoKey string
    CronExp string
    Cron expression to control the operation frequency.
    EnableEventReplication bool
    Replications []ReplicationConfigReplicationArgs
    RepoKey string
    cronExp String
    Cron expression to control the operation frequency.
    enableEventReplication Boolean
    replications List<ReplicationConfigReplication>
    repoKey String
    cronExp string
    Cron expression to control the operation frequency.
    enableEventReplication boolean
    replications ReplicationConfigReplication[]
    repoKey string
    cron_exp str
    Cron expression to control the operation frequency.
    enable_event_replication bool
    replications Sequence[ReplicationConfigReplicationArgs]
    repo_key str
    cronExp String
    Cron expression to control the operation frequency.
    enableEventReplication Boolean
    replications List<Property Map>
    repoKey String

    Supporting Types

    ReplicationConfigReplication, ReplicationConfigReplicationArgs

    Enabled bool
    Password string
    Requires password encryption to be turned off POST /api/system/decrypt.
    PathPrefix string
    Proxy string
    Proxy key from Artifactory Proxies setting
    SocketTimeoutMillis int
    SyncDeletes bool
    SyncProperties bool
    SyncStatistics bool
    Url string
    Username string
    Enabled bool
    Password string
    Requires password encryption to be turned off POST /api/system/decrypt.
    PathPrefix string
    Proxy string
    Proxy key from Artifactory Proxies setting
    SocketTimeoutMillis int
    SyncDeletes bool
    SyncProperties bool
    SyncStatistics bool
    Url string
    Username string
    enabled Boolean
    password String
    Requires password encryption to be turned off POST /api/system/decrypt.
    pathPrefix String
    proxy String
    Proxy key from Artifactory Proxies setting
    socketTimeoutMillis Integer
    syncDeletes Boolean
    syncProperties Boolean
    syncStatistics Boolean
    url String
    username String
    enabled boolean
    password string
    Requires password encryption to be turned off POST /api/system/decrypt.
    pathPrefix string
    proxy string
    Proxy key from Artifactory Proxies setting
    socketTimeoutMillis number
    syncDeletes boolean
    syncProperties boolean
    syncStatistics boolean
    url string
    username string
    enabled bool
    password str
    Requires password encryption to be turned off POST /api/system/decrypt.
    path_prefix str
    proxy str
    Proxy key from Artifactory Proxies setting
    socket_timeout_millis int
    sync_deletes bool
    sync_properties bool
    sync_statistics bool
    url str
    username str
    enabled Boolean
    password String
    Requires password encryption to be turned off POST /api/system/decrypt.
    pathPrefix String
    proxy String
    Proxy key from Artifactory Proxies setting
    socketTimeoutMillis Number
    syncDeletes Boolean
    syncProperties Boolean
    syncStatistics Boolean
    url String
    username String

    Import

    Replication configs can be imported using their repo key, e.g.

    $ pulumi import artifactory:index/replicationConfig:ReplicationConfig foo-rep provider_test_source
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    artifactory pulumi/pulumi-artifactory
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the artifactory Terraform Provider.
    artifactory logo
    artifactory v6.6.1 published on Thursday, Apr 18, 2024 by Pulumi