1. Packages
  2. Artifactory Provider
  3. API Docs
  4. ItemProperties
artifactory v8.1.0 published on Saturday, Sep 28, 2024 by Pulumi

artifactory.ItemProperties

Explore with Pulumi AI

artifactory logo
artifactory v8.1.0 published on Saturday, Sep 28, 2024 by Pulumi

    Provides a resource for managaing item (file, folder, or repository) properties. When a folder is used property attachment is recursive by default. See JFrog documentation for more details.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as artifactory from "@pulumi/artifactory";
    
    const my_repo_properties = new artifactory.ItemProperties("my-repo-properties", {
        repoKey: "my-generic-local",
        properties: {
            key1: ["value1"],
            key2: [
                "value2",
                "value3",
            ],
        },
        isRecursive: true,
    });
    const my_folder_properties = new artifactory.ItemProperties("my-folder-properties", {
        repoKey: "my-generic-local",
        itemPath: "folder/subfolder",
        properties: {
            key1: ["value1"],
            key2: [
                "value2",
                "value3",
            ],
        },
        isRecursive: true,
    });
    
    import pulumi
    import pulumi_artifactory as artifactory
    
    my_repo_properties = artifactory.ItemProperties("my-repo-properties",
        repo_key="my-generic-local",
        properties={
            "key1": ["value1"],
            "key2": [
                "value2",
                "value3",
            ],
        },
        is_recursive=True)
    my_folder_properties = artifactory.ItemProperties("my-folder-properties",
        repo_key="my-generic-local",
        item_path="folder/subfolder",
        properties={
            "key1": ["value1"],
            "key2": [
                "value2",
                "value3",
            ],
        },
        is_recursive=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-artifactory/sdk/v8/go/artifactory"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := artifactory.NewItemProperties(ctx, "my-repo-properties", &artifactory.ItemPropertiesArgs{
    			RepoKey: pulumi.String("my-generic-local"),
    			Properties: pulumi.StringArrayMap{
    				"key1": pulumi.StringArray{
    					pulumi.String("value1"),
    				},
    				"key2": pulumi.StringArray{
    					pulumi.String("value2"),
    					pulumi.String("value3"),
    				},
    			},
    			IsRecursive: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = artifactory.NewItemProperties(ctx, "my-folder-properties", &artifactory.ItemPropertiesArgs{
    			RepoKey:  pulumi.String("my-generic-local"),
    			ItemPath: pulumi.String("folder/subfolder"),
    			Properties: pulumi.StringArrayMap{
    				"key1": pulumi.StringArray{
    					pulumi.String("value1"),
    				},
    				"key2": pulumi.StringArray{
    					pulumi.String("value2"),
    					pulumi.String("value3"),
    				},
    			},
    			IsRecursive: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Artifactory = Pulumi.Artifactory;
    
    return await Deployment.RunAsync(() => 
    {
        var my_repo_properties = new Artifactory.ItemProperties("my-repo-properties", new()
        {
            RepoKey = "my-generic-local",
            Properties = 
            {
                { "key1", new[]
                {
                    "value1",
                } },
                { "key2", new[]
                {
                    "value2",
                    "value3",
                } },
            },
            IsRecursive = true,
        });
    
        var my_folder_properties = new Artifactory.ItemProperties("my-folder-properties", new()
        {
            RepoKey = "my-generic-local",
            ItemPath = "folder/subfolder",
            Properties = 
            {
                { "key1", new[]
                {
                    "value1",
                } },
                { "key2", new[]
                {
                    "value2",
                    "value3",
                } },
            },
            IsRecursive = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.artifactory.ItemProperties;
    import com.pulumi.artifactory.ItemPropertiesArgs;
    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 my_repo_properties = new ItemProperties("my-repo-properties", ItemPropertiesArgs.builder()
                .repoKey("my-generic-local")
                .properties(Map.ofEntries(
                    Map.entry("key1", "value1"),
                    Map.entry("key2",                 
                        "value2",
                        "value3")
                ))
                .isRecursive(true)
                .build());
    
            var my_folder_properties = new ItemProperties("my-folder-properties", ItemPropertiesArgs.builder()
                .repoKey("my-generic-local")
                .itemPath("folder/subfolder")
                .properties(Map.ofEntries(
                    Map.entry("key1", "value1"),
                    Map.entry("key2",                 
                        "value2",
                        "value3")
                ))
                .isRecursive(true)
                .build());
    
        }
    }
    
    resources:
      my-repo-properties:
        type: artifactory:ItemProperties
        properties:
          repoKey: my-generic-local
          properties:
            key1:
              - value1
            key2:
              - value2
              - value3
          isRecursive: true
      my-folder-properties:
        type: artifactory:ItemProperties
        properties:
          repoKey: my-generic-local
          itemPath: folder/subfolder
          properties:
            key1:
              - value1
            key2:
              - value2
              - value3
          isRecursive: true
    

    Create ItemProperties Resource

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

    Constructor syntax

    new ItemProperties(name: string, args: ItemPropertiesArgs, opts?: CustomResourceOptions);
    @overload
    def ItemProperties(resource_name: str,
                       args: ItemPropertiesArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ItemProperties(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       properties: Optional[Mapping[str, Sequence[str]]] = None,
                       repo_key: Optional[str] = None,
                       is_recursive: Optional[bool] = None,
                       item_path: Optional[str] = None)
    func NewItemProperties(ctx *Context, name string, args ItemPropertiesArgs, opts ...ResourceOption) (*ItemProperties, error)
    public ItemProperties(string name, ItemPropertiesArgs args, CustomResourceOptions? opts = null)
    public ItemProperties(String name, ItemPropertiesArgs args)
    public ItemProperties(String name, ItemPropertiesArgs args, CustomResourceOptions options)
    
    type: artifactory:ItemProperties
    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 ItemPropertiesArgs
    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 ItemPropertiesArgs
    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 ItemPropertiesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ItemPropertiesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ItemPropertiesArgs
    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 itemPropertiesResource = new Artifactory.ItemProperties("itemPropertiesResource", new()
    {
        Properties = 
        {
            { "string", new[]
            {
                "string",
            } },
        },
        RepoKey = "string",
        IsRecursive = false,
        ItemPath = "string",
    });
    
    example, err := artifactory.NewItemProperties(ctx, "itemPropertiesResource", &artifactory.ItemPropertiesArgs{
    	Properties: pulumi.StringArrayMap{
    		"string": pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	RepoKey:     pulumi.String("string"),
    	IsRecursive: pulumi.Bool(false),
    	ItemPath:    pulumi.String("string"),
    })
    
    var itemPropertiesResource = new ItemProperties("itemPropertiesResource", ItemPropertiesArgs.builder()
        .properties(Map.of("string", "string"))
        .repoKey("string")
        .isRecursive(false)
        .itemPath("string")
        .build());
    
    item_properties_resource = artifactory.ItemProperties("itemPropertiesResource",
        properties={
            "string": ["string"],
        },
        repo_key="string",
        is_recursive=False,
        item_path="string")
    
    const itemPropertiesResource = new artifactory.ItemProperties("itemPropertiesResource", {
        properties: {
            string: ["string"],
        },
        repoKey: "string",
        isRecursive: false,
        itemPath: "string",
    });
    
    type: artifactory:ItemProperties
    properties:
        isRecursive: false
        itemPath: string
        properties:
            string:
                - string
        repoKey: string
    

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

    Properties Dictionary<string, ImmutableArray<string>>
    Map of key and list of values.
    RepoKey string
    Respository key.
    IsRecursive bool
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    ItemPath string
    The relative path of the item (file/folder/repository). Leave unset for repository.
    Properties map[string][]string
    Map of key and list of values.
    RepoKey string
    Respository key.
    IsRecursive bool
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    ItemPath string
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties Map<String,List<String>>
    Map of key and list of values.
    repoKey String
    Respository key.
    isRecursive Boolean
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    itemPath String
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties {[key: string]: string[]}
    Map of key and list of values.
    repoKey string
    Respository key.
    isRecursive boolean
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    itemPath string
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties Mapping[str, Sequence[str]]
    Map of key and list of values.
    repo_key str
    Respository key.
    is_recursive bool
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    item_path str
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties Map<List<String>>
    Map of key and list of values.
    repoKey String
    Respository key.
    isRecursive Boolean
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    itemPath String
    The relative path of the item (file/folder/repository). Leave unset for repository.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ItemProperties 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 ItemProperties Resource

    Get an existing ItemProperties 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?: ItemPropertiesState, opts?: CustomResourceOptions): ItemProperties
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            is_recursive: Optional[bool] = None,
            item_path: Optional[str] = None,
            properties: Optional[Mapping[str, Sequence[str]]] = None,
            repo_key: Optional[str] = None) -> ItemProperties
    func GetItemProperties(ctx *Context, name string, id IDInput, state *ItemPropertiesState, opts ...ResourceOption) (*ItemProperties, error)
    public static ItemProperties Get(string name, Input<string> id, ItemPropertiesState? state, CustomResourceOptions? opts = null)
    public static ItemProperties get(String name, Output<String> id, ItemPropertiesState 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:
    IsRecursive bool
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    ItemPath string
    The relative path of the item (file/folder/repository). Leave unset for repository.
    Properties Dictionary<string, ImmutableArray<string>>
    Map of key and list of values.
    RepoKey string
    Respository key.
    IsRecursive bool
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    ItemPath string
    The relative path of the item (file/folder/repository). Leave unset for repository.
    Properties map[string][]string
    Map of key and list of values.
    RepoKey string
    Respository key.
    isRecursive Boolean
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    itemPath String
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties Map<String,List<String>>
    Map of key and list of values.
    repoKey String
    Respository key.
    isRecursive boolean
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    itemPath string
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties {[key: string]: string[]}
    Map of key and list of values.
    repoKey string
    Respository key.
    is_recursive bool
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    item_path str
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties Mapping[str, Sequence[str]]
    Map of key and list of values.
    repo_key str
    Respository key.
    isRecursive Boolean
    Add this property to the selected folder and to all of artifacts and folders under this folder. Default to false
    itemPath String
    The relative path of the item (file/folder/repository). Leave unset for repository.
    properties Map<List<String>>
    Map of key and list of values.
    repoKey String
    Respository key.

    Import

    $ pulumi import artifactory:index/itemProperties:ItemProperties my-repo-properties repo_key
    
    $ pulumi import artifactory:index/itemProperties:ItemProperties my-folder-properties repo_key:folder/subfolder
    

    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 v8.1.0 published on Saturday, Sep 28, 2024 by Pulumi