1. Packages
  2. Cyral Provider
  3. API Docs
  4. RepositoryDatamap
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

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"],
        },
    ],
});
Copy
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"],
        },
    ])
Copy
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
	})
}
Copy
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",
                },
            },
        },
    });

});
Copy
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());

    }
}
Copy
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
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. RepositoryDatamapArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. RepositoryDatamapArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryDatamapArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := cyral.NewRepositoryDatamap(ctx, "repositoryDatamapResource", &cyral.RepositoryDatamapArgs{
Mappings: .RepositoryDatamapMappingArray{
&.RepositoryDatamapMappingArgs{
Attributes: pulumi.StringArray{
pulumi.String("string"),
},
Label: pulumi.String("string"),
},
},
RepositoryId: pulumi.String("string"),
RepositoryDatamapId: pulumi.String("string"),
})
Copy
var repositoryDatamapResource = new RepositoryDatamap("repositoryDatamapResource", RepositoryDatamapArgs.builder()
    .mappings(RepositoryDatamapMappingArgs.builder()
        .attributes("string")
        .label("string")
        .build())
    .repositoryId("string")
    .repositoryDatamapId("string")
    .build());
Copy
repository_datamap_resource = cyral.RepositoryDatamap("repositoryDatamapResource",
    mappings=[{
        "attributes": ["string"],
        "label": "string",
    }],
    repository_id="string",
    repository_datamap_id="string")
Copy
const repositoryDatamapResource = new cyral.RepositoryDatamap("repositoryDatamapResource", {
    mappings: [{
        attributes: ["string"],
        label: "string",
    }],
    repositoryId: "string",
    repositoryDatamapId: "string",
});
Copy
type: cyral:RepositoryDatamap
properties:
    mappings:
        - attributes:
            - string
          label: string
    repositoryDatamapId: string
    repositoryId: string
Copy

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 This property is required. List<RepositoryDatamapMapping>
Mapping of a label to a list of data locations (attributes).
RepositoryId This property is required. string
ID of the repository for which to configure a data map.
RepositoryDatamapId string
The ID of this resource.
Mappings This property is required. []RepositoryDatamapMappingArgs
Mapping of a label to a list of data locations (attributes).
RepositoryId This property is required. string
ID of the repository for which to configure a data map.
RepositoryDatamapId string
The ID of this resource.
mappings This property is required. List<RepositoryDatamapMapping>
Mapping of a label to a list of data locations (attributes).
repositoryId This property is required. String
ID of the repository for which to configure a data map.
repositoryDatamapId String
The ID of this resource.
mappings This property is required. RepositoryDatamapMapping[]
Mapping of a label to a list of data locations (attributes).
repositoryId This property is required. string
ID of the repository for which to configure a data map.
repositoryDatamapId string
The ID of this resource.
mappings This property is required. Sequence[RepositoryDatamapMappingArgs]
Mapping of a label to a list of data locations (attributes).
repository_id This property is required. str
ID of the repository for which to configure a data map.
repository_datamap_id str
The ID of this resource.
mappings This property is required. List<Property Map>
Mapping of a label to a list of data locations (attributes).
repositoryId This property is required. String
ID of the repository for which to configure a data map.
repositoryDatamapId String
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) -> RepositoryDatamap
func 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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Mappings List<RepositoryDatamapMapping>
Mapping of a label to a list of data locations (attributes).
RepositoryDatamapId string
The ID of this resource.
RepositoryId string
ID of the repository for which to configure a data map.
Mappings []RepositoryDatamapMappingArgs
Mapping of a label to a list of data locations (attributes).
RepositoryDatamapId string
The ID of this resource.
RepositoryId string
ID of the repository for which to configure a data map.
mappings List<RepositoryDatamapMapping>
Mapping of a label to a list of data locations (attributes).
repositoryDatamapId String
The ID of this resource.
repositoryId String
ID of the repository for which to configure a data map.
mappings RepositoryDatamapMapping[]
Mapping of a label to a list of data locations (attributes).
repositoryDatamapId string
The ID of this resource.
repositoryId string
ID of the repository for which to configure a data map.
mappings Sequence[RepositoryDatamapMappingArgs]
Mapping of a label to a list of data locations (attributes).
repository_datamap_id str
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).
repositoryDatamapId String
The ID of this resource.
repositoryId String
ID of the repository for which to configure a data map.

Supporting Types

RepositoryDatamapMapping
, RepositoryDatamapMappingArgs

Attributes This property is required. 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 This property is required. string
Label given to the attributes in this mapping.
Attributes This property is required. []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 This property is required. string
Label given to the attributes in this mapping.
attributes This property is required. 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 This property is required. String
Label given to the attributes in this mapping.
attributes This property is required. 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 This property is required. string
Label given to the attributes in this mapping.
attributes This property is required. 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 This property is required. str
Label given to the attributes in this mapping.
attributes This property is required. 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 This property is required. 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 cyral Terraform Provider.