cyral.RepositoryDatamap
Explore with Pulumi AI
Manages Data Map.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cyral from "@pulumi/cyral";
// Create the repository
const example_pg = new cyral.Repository("example-pg", {
    type: "postgresql",
    repoNodes: [{
        host: "pg.example.com",
        port: 5432,
    }],
});
// Create custom labels
const nAME = new cyral.Datalabel("nAME", {
    description: "Customer name",
    tags: ["PII"],
});
const dOB = new cyral.Datalabel("dOB", {
    description: "Customer date of birth",
    tags: ["PII"],
});
// Create data map for the repository, using the custom labels
const example_pgDatamap = new cyral.RepositoryDatamap("example-pgDatamap", {
    repositoryId: example_pg.id,
    mappings: [
        {
            label: nAME.name,
            attributes: [
                "FINANCE.CUSTOMERS.FIRST_NAME",
                "FINANCE.CUSTOMERS.MIDDLE_NAME",
                "FINANCE.CUSTOMERS.LAST_NAME",
            ],
        },
        {
            label: dOB.name,
            attributes: ["FINANCE.CUSTOMERS.DOB"],
        },
    ],
});
import pulumi
import pulumi_cyral as cyral
# Create the repository
example_pg = cyral.Repository("example-pg",
    type="postgresql",
    repo_nodes=[{
        "host": "pg.example.com",
        "port": 5432,
    }])
# Create custom labels
n_ame = cyral.Datalabel("nAME",
    description="Customer name",
    tags=["PII"])
d_ob = cyral.Datalabel("dOB",
    description="Customer date of birth",
    tags=["PII"])
# Create data map for the repository, using the custom labels
example_pg_datamap = cyral.RepositoryDatamap("example-pgDatamap",
    repository_id=example_pg.id,
    mappings=[
        {
            "label": n_ame.name,
            "attributes": [
                "FINANCE.CUSTOMERS.FIRST_NAME",
                "FINANCE.CUSTOMERS.MIDDLE_NAME",
                "FINANCE.CUSTOMERS.LAST_NAME",
            ],
        },
        {
            "label": d_ob.name,
            "attributes": ["FINANCE.CUSTOMERS.DOB"],
        },
    ])
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cyral/v4/cyral"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create the repository
		example_pg, err := cyral.NewRepository(ctx, "example-pg", &cyral.RepositoryArgs{
			Type: pulumi.String("postgresql"),
			RepoNodes: cyral.RepositoryRepoNodeArray{
				&cyral.RepositoryRepoNodeArgs{
					Host: pulumi.String("pg.example.com"),
					Port: pulumi.Float64(5432),
				},
			},
		})
		if err != nil {
			return err
		}
		// Create custom labels
		nAME, err := cyral.NewDatalabel(ctx, "nAME", &cyral.DatalabelArgs{
			Description: pulumi.String("Customer name"),
			Tags: pulumi.StringArray{
				pulumi.String("PII"),
			},
		})
		if err != nil {
			return err
		}
		dOB, err := cyral.NewDatalabel(ctx, "dOB", &cyral.DatalabelArgs{
			Description: pulumi.String("Customer date of birth"),
			Tags: pulumi.StringArray{
				pulumi.String("PII"),
			},
		})
		if err != nil {
			return err
		}
		// Create data map for the repository, using the custom labels
		_, err = cyral.NewRepositoryDatamap(ctx, "example-pgDatamap", &cyral.RepositoryDatamapArgs{
			RepositoryId: example_pg.ID(),
			Mappings: cyral.RepositoryDatamapMappingArray{
				&cyral.RepositoryDatamapMappingArgs{
					Label: nAME.Name,
					Attributes: pulumi.StringArray{
						pulumi.String("FINANCE.CUSTOMERS.FIRST_NAME"),
						pulumi.String("FINANCE.CUSTOMERS.MIDDLE_NAME"),
						pulumi.String("FINANCE.CUSTOMERS.LAST_NAME"),
					},
				},
				&cyral.RepositoryDatamapMappingArgs{
					Label: dOB.Name,
					Attributes: pulumi.StringArray{
						pulumi.String("FINANCE.CUSTOMERS.DOB"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cyral = Pulumi.Cyral;
return await Deployment.RunAsync(() => 
{
    // Create the repository
    var example_pg = new Cyral.Repository("example-pg", new()
    {
        Type = "postgresql",
        RepoNodes = new[]
        {
            new Cyral.Inputs.RepositoryRepoNodeArgs
            {
                Host = "pg.example.com",
                Port = 5432,
            },
        },
    });
    // Create custom labels
    var nAME = new Cyral.Datalabel("nAME", new()
    {
        Description = "Customer name",
        Tags = new[]
        {
            "PII",
        },
    });
    var dOB = new Cyral.Datalabel("dOB", new()
    {
        Description = "Customer date of birth",
        Tags = new[]
        {
            "PII",
        },
    });
    // Create data map for the repository, using the custom labels
    var example_pgDatamap = new Cyral.RepositoryDatamap("example-pgDatamap", new()
    {
        RepositoryId = example_pg.Id,
        Mappings = new[]
        {
            new Cyral.Inputs.RepositoryDatamapMappingArgs
            {
                Label = nAME.Name,
                Attributes = new[]
                {
                    "FINANCE.CUSTOMERS.FIRST_NAME",
                    "FINANCE.CUSTOMERS.MIDDLE_NAME",
                    "FINANCE.CUSTOMERS.LAST_NAME",
                },
            },
            new Cyral.Inputs.RepositoryDatamapMappingArgs
            {
                Label = dOB.Name,
                Attributes = new[]
                {
                    "FINANCE.CUSTOMERS.DOB",
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cyral.Repository;
import com.pulumi.cyral.RepositoryArgs;
import com.pulumi.cyral.inputs.RepositoryRepoNodeArgs;
import com.pulumi.cyral.Datalabel;
import com.pulumi.cyral.DatalabelArgs;
import com.pulumi.cyral.RepositoryDatamap;
import com.pulumi.cyral.RepositoryDatamapArgs;
import com.pulumi.cyral.inputs.RepositoryDatamapMappingArgs;
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 the repository
        var example_pg = new Repository("example-pg", RepositoryArgs.builder()
            .type("postgresql")
            .repoNodes(RepositoryRepoNodeArgs.builder()
                .host("pg.example.com")
                .port(5432)
                .build())
            .build());
        // Create custom labels
        var nAME = new Datalabel("nAME", DatalabelArgs.builder()
            .description("Customer name")
            .tags("PII")
            .build());
        var dOB = new Datalabel("dOB", DatalabelArgs.builder()
            .description("Customer date of birth")
            .tags("PII")
            .build());
        // Create data map for the repository, using the custom labels
        var example_pgDatamap = new RepositoryDatamap("example-pgDatamap", RepositoryDatamapArgs.builder()
            .repositoryId(example_pg.id())
            .mappings(            
                RepositoryDatamapMappingArgs.builder()
                    .label(nAME.name())
                    .attributes(                    
                        "FINANCE.CUSTOMERS.FIRST_NAME",
                        "FINANCE.CUSTOMERS.MIDDLE_NAME",
                        "FINANCE.CUSTOMERS.LAST_NAME")
                    .build(),
                RepositoryDatamapMappingArgs.builder()
                    .label(dOB.name())
                    .attributes("FINANCE.CUSTOMERS.DOB")
                    .build())
            .build());
    }
}
resources:
  # Create the repository
  example-pg:
    type: cyral:Repository
    properties:
      type: postgresql
      repoNodes:
        - host: pg.example.com
          port: 5432
  # Create custom labels
  nAME:
    type: cyral:Datalabel
    properties:
      description: Customer name
      tags:
        - PII
  dOB:
    type: cyral:Datalabel
    properties:
      description: Customer date of birth
      tags:
        - PII
  # Create data map for the repository, using the custom labels
  example-pgDatamap:
    type: cyral:RepositoryDatamap
    properties:
      repositoryId: ${["example-pg"].id}
      mappings:
        - label: ${nAME.name}
          attributes:
            - FINANCE.CUSTOMERS.FIRST_NAME
            - FINANCE.CUSTOMERS.MIDDLE_NAME
            - FINANCE.CUSTOMERS.LAST_NAME
        - label: ${dOB.name}
          attributes:
            - FINANCE.CUSTOMERS.DOB
Create RepositoryDatamap Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RepositoryDatamap(name: string, args: RepositoryDatamapArgs, opts?: CustomResourceOptions);@overload
def RepositoryDatamap(resource_name: str,
                      args: RepositoryDatamapArgs,
                      opts: Optional[ResourceOptions] = None)
@overload
def RepositoryDatamap(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      mappings: Optional[Sequence[RepositoryDatamapMappingArgs]] = None,
                      repository_id: Optional[str] = None,
                      repository_datamap_id: Optional[str] = None)func NewRepositoryDatamap(ctx *Context, name string, args RepositoryDatamapArgs, opts ...ResourceOption) (*RepositoryDatamap, error)public RepositoryDatamap(string name, RepositoryDatamapArgs args, CustomResourceOptions? opts = null)
public RepositoryDatamap(String name, RepositoryDatamapArgs args)
public RepositoryDatamap(String name, RepositoryDatamapArgs args, CustomResourceOptions options)
type: cyral:RepositoryDatamap
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 RepositoryDatamapArgs
- 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 RepositoryDatamapArgs
- 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 RepositoryDatamapArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryDatamapArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryDatamapArgs
- 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 repositoryDatamapResource = new Cyral.RepositoryDatamap("repositoryDatamapResource", new()
{
    Mappings = new[]
    {
        new Cyral.Inputs.RepositoryDatamapMappingArgs
        {
            Attributes = new[]
            {
                "string",
            },
            Label = "string",
        },
    },
    RepositoryId = "string",
    RepositoryDatamapId = "string",
});
example, err := cyral.NewRepositoryDatamap(ctx, "repositoryDatamapResource", &cyral.RepositoryDatamapArgs{
	Mappings: cyral.RepositoryDatamapMappingArray{
		&cyral.RepositoryDatamapMappingArgs{
			Attributes: pulumi.StringArray{
				pulumi.String("string"),
			},
			Label: pulumi.String("string"),
		},
	},
	RepositoryId:        pulumi.String("string"),
	RepositoryDatamapId: pulumi.String("string"),
})
var repositoryDatamapResource = new RepositoryDatamap("repositoryDatamapResource", RepositoryDatamapArgs.builder()
    .mappings(RepositoryDatamapMappingArgs.builder()
        .attributes("string")
        .label("string")
        .build())
    .repositoryId("string")
    .repositoryDatamapId("string")
    .build());
repository_datamap_resource = cyral.RepositoryDatamap("repositoryDatamapResource",
    mappings=[{
        "attributes": ["string"],
        "label": "string",
    }],
    repository_id="string",
    repository_datamap_id="string")
const repositoryDatamapResource = new cyral.RepositoryDatamap("repositoryDatamapResource", {
    mappings: [{
        attributes: ["string"],
        label: "string",
    }],
    repositoryId: "string",
    repositoryDatamapId: "string",
});
type: cyral:RepositoryDatamap
properties:
    mappings:
        - attributes:
            - string
          label: string
    repositoryDatamapId: string
    repositoryId: string
RepositoryDatamap Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RepositoryDatamap resource accepts the following input properties:
- Mappings
List<RepositoryDatamap Mapping> 
- Mapping of a label to a list of data locations (attributes).
- RepositoryId string
- ID of the repository for which to configure a data map.
- RepositoryDatamap stringId 
- The ID of this resource.
- Mappings
[]RepositoryDatamap Mapping Args 
- Mapping of a label to a list of data locations (attributes).
- RepositoryId string
- ID of the repository for which to configure a data map.
- RepositoryDatamap stringId 
- The ID of this resource.
- mappings
List<RepositoryDatamap Mapping> 
- Mapping of a label to a list of data locations (attributes).
- repositoryId String
- ID of the repository for which to configure a data map.
- repositoryDatamap StringId 
- The ID of this resource.
- mappings
RepositoryDatamap Mapping[] 
- Mapping of a label to a list of data locations (attributes).
- repositoryId string
- ID of the repository for which to configure a data map.
- repositoryDatamap stringId 
- The ID of this resource.
- mappings
Sequence[RepositoryDatamap Mapping Args] 
- Mapping of a label to a list of data locations (attributes).
- repository_id str
- ID of the repository for which to configure a data map.
- repository_datamap_ strid 
- The ID of this resource.
- mappings List<Property Map>
- Mapping of a label to a list of data locations (attributes).
- repositoryId String
- ID of the repository for which to configure a data map.
- repositoryDatamap StringId 
- The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the RepositoryDatamap 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 RepositoryDatamap Resource
Get an existing RepositoryDatamap 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?: RepositoryDatamapState, opts?: CustomResourceOptions): RepositoryDatamap@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        mappings: Optional[Sequence[RepositoryDatamapMappingArgs]] = None,
        repository_datamap_id: Optional[str] = None,
        repository_id: Optional[str] = None) -> RepositoryDatamapfunc GetRepositoryDatamap(ctx *Context, name string, id IDInput, state *RepositoryDatamapState, opts ...ResourceOption) (*RepositoryDatamap, error)public static RepositoryDatamap Get(string name, Input<string> id, RepositoryDatamapState? state, CustomResourceOptions? opts = null)public static RepositoryDatamap get(String name, Output<String> id, RepositoryDatamapState state, CustomResourceOptions options)resources:  _:    type: cyral:RepositoryDatamap    get:      id: ${id}- 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.
- Mappings
List<RepositoryDatamap Mapping> 
- Mapping of a label to a list of data locations (attributes).
- RepositoryDatamap stringId 
- The ID of this resource.
- RepositoryId string
- ID of the repository for which to configure a data map.
- Mappings
[]RepositoryDatamap Mapping Args 
- Mapping of a label to a list of data locations (attributes).
- RepositoryDatamap stringId 
- The ID of this resource.
- RepositoryId string
- ID of the repository for which to configure a data map.
- mappings
List<RepositoryDatamap Mapping> 
- Mapping of a label to a list of data locations (attributes).
- repositoryDatamap StringId 
- The ID of this resource.
- repositoryId String
- ID of the repository for which to configure a data map.
- mappings
RepositoryDatamap Mapping[] 
- Mapping of a label to a list of data locations (attributes).
- repositoryDatamap stringId 
- The ID of this resource.
- repositoryId string
- ID of the repository for which to configure a data map.
- mappings
Sequence[RepositoryDatamap Mapping Args] 
- Mapping of a label to a list of data locations (attributes).
- repository_datamap_ strid 
- The ID of this resource.
- repository_id str
- ID of the repository for which to configure a data map.
- mappings List<Property Map>
- Mapping of a label to a list of data locations (attributes).
- repositoryDatamap StringId 
- The ID of this resource.
- repositoryId String
- ID of the repository for which to configure a data map.
Supporting Types
RepositoryDatamapMapping, RepositoryDatamapMappingArgs      
- Attributes List<string>
- List containing the specific locations of the data within the repo, following the pattern {SCHEMA}.{TABLE}.{ATTRIBUTE}(ex:[your_schema_name.your_table_name.your_attr_name]).
- Label string
- Label given to the attributes in this mapping.
- Attributes []string
- List containing the specific locations of the data within the repo, following the pattern {SCHEMA}.{TABLE}.{ATTRIBUTE}(ex:[your_schema_name.your_table_name.your_attr_name]).
- Label string
- Label given to the attributes in this mapping.
- attributes List<String>
- List containing the specific locations of the data within the repo, following the pattern {SCHEMA}.{TABLE}.{ATTRIBUTE}(ex:[your_schema_name.your_table_name.your_attr_name]).
- label String
- Label given to the attributes in this mapping.
- attributes string[]
- List containing the specific locations of the data within the repo, following the pattern {SCHEMA}.{TABLE}.{ATTRIBUTE}(ex:[your_schema_name.your_table_name.your_attr_name]).
- label string
- Label given to the attributes in this mapping.
- attributes Sequence[str]
- List containing the specific locations of the data within the repo, following the pattern {SCHEMA}.{TABLE}.{ATTRIBUTE}(ex:[your_schema_name.your_table_name.your_attr_name]).
- label str
- Label given to the attributes in this mapping.
- attributes List<String>
- List containing the specific locations of the data within the repo, following the pattern {SCHEMA}.{TABLE}.{ATTRIBUTE}(ex:[your_schema_name.your_table_name.your_attr_name]).
- label String
- Label given to the attributes in this mapping.
Package Details
- Repository
- cyral cyralinc/terraform-provider-cyral
- License
- Notes
- This Pulumi package is based on the cyralTerraform Provider.