grafana.cloud.PrivateDataSourceConnectNetworkToken
Explore with Pulumi AI
Required access policy scopes:
- accesspolicies:read
- accesspolicies:write
- accesspolicies:delete
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";
const current = grafana.cloud.getStack({
    slug: "<your slug>",
});
const test = new grafana.cloud.PrivateDataSourceConnectNetwork("test", {
    region: "prod-us-east-0",
    name: "my-pdc",
    displayName: "My PDC",
    stackIdentifier: current.then(current => current.id),
});
const testPrivateDataSourceConnectNetworkToken = new grafana.cloud.PrivateDataSourceConnectNetworkToken("test", {
    pdcNetworkId: test.pdcNetworkId,
    region: test.region,
    name: "my-pdc-token",
    displayName: "My PDC Token",
});
import pulumi
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana
current = grafana.cloud.get_stack(slug="<your slug>")
test = grafana.cloud.PrivateDataSourceConnectNetwork("test",
    region="prod-us-east-0",
    name="my-pdc",
    display_name="My PDC",
    stack_identifier=current.id)
test_private_data_source_connect_network_token = grafana.cloud.PrivateDataSourceConnectNetworkToken("test",
    pdc_network_id=test.pdc_network_id,
    region=test.region,
    name="my-pdc-token",
    display_name="My PDC Token")
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/cloud"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := cloud.LookupStack(ctx, &cloud.LookupStackArgs{
			Slug: "<your slug>",
		}, nil)
		if err != nil {
			return err
		}
		test, err := cloud.NewPrivateDataSourceConnectNetwork(ctx, "test", &cloud.PrivateDataSourceConnectNetworkArgs{
			Region:          pulumi.String("prod-us-east-0"),
			Name:            pulumi.String("my-pdc"),
			DisplayName:     pulumi.String("My PDC"),
			StackIdentifier: pulumi.String(current.Id),
		})
		if err != nil {
			return err
		}
		_, err = cloud.NewPrivateDataSourceConnectNetworkToken(ctx, "test", &cloud.PrivateDataSourceConnectNetworkTokenArgs{
			PdcNetworkId: test.PdcNetworkId,
			Region:       test.Region,
			Name:         pulumi.String("my-pdc-token"),
			DisplayName:  pulumi.String("My PDC Token"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() => 
{
    var current = Grafana.Cloud.GetStack.Invoke(new()
    {
        Slug = "<your slug>",
    });
    var test = new Grafana.Cloud.PrivateDataSourceConnectNetwork("test", new()
    {
        Region = "prod-us-east-0",
        Name = "my-pdc",
        DisplayName = "My PDC",
        StackIdentifier = current.Apply(getStackResult => getStackResult.Id),
    });
    var testPrivateDataSourceConnectNetworkToken = new Grafana.Cloud.PrivateDataSourceConnectNetworkToken("test", new()
    {
        PdcNetworkId = test.PdcNetworkId,
        Region = test.Region,
        Name = "my-pdc-token",
        DisplayName = "My PDC Token",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.cloud.CloudFunctions;
import com.pulumi.grafana.cloud.inputs.GetStackArgs;
import com.pulumi.grafana.cloud.PrivateDataSourceConnectNetwork;
import com.pulumi.grafana.cloud.PrivateDataSourceConnectNetworkArgs;
import com.pulumi.grafana.cloud.PrivateDataSourceConnectNetworkToken;
import com.pulumi.grafana.cloud.PrivateDataSourceConnectNetworkTokenArgs;
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) {
        final var current = CloudFunctions.getStack(GetStackArgs.builder()
            .slug("<your slug>")
            .build());
        var test = new PrivateDataSourceConnectNetwork("test", PrivateDataSourceConnectNetworkArgs.builder()
            .region("prod-us-east-0")
            .name("my-pdc")
            .displayName("My PDC")
            .stackIdentifier(current.applyValue(getStackResult -> getStackResult.id()))
            .build());
        var testPrivateDataSourceConnectNetworkToken = new PrivateDataSourceConnectNetworkToken("testPrivateDataSourceConnectNetworkToken", PrivateDataSourceConnectNetworkTokenArgs.builder()
            .pdcNetworkId(test.pdcNetworkId())
            .region(test.region())
            .name("my-pdc-token")
            .displayName("My PDC Token")
            .build());
    }
}
resources:
  test:
    type: grafana:cloud:PrivateDataSourceConnectNetwork
    properties:
      region: prod-us-east-0
      name: my-pdc
      displayName: My PDC
      stackIdentifier: ${current.id}
  testPrivateDataSourceConnectNetworkToken:
    type: grafana:cloud:PrivateDataSourceConnectNetworkToken
    name: test
    properties:
      pdcNetworkId: ${test.pdcNetworkId}
      region: ${test.region}
      name: my-pdc-token
      displayName: My PDC Token
variables:
  current:
    fn::invoke:
      function: grafana:cloud:getStack
      arguments:
        slug: <your slug>
Create PrivateDataSourceConnectNetworkToken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PrivateDataSourceConnectNetworkToken(name: string, args: PrivateDataSourceConnectNetworkTokenArgs, opts?: CustomResourceOptions);@overload
def PrivateDataSourceConnectNetworkToken(resource_name: str,
                                         args: PrivateDataSourceConnectNetworkTokenArgs,
                                         opts: Optional[ResourceOptions] = None)
@overload
def PrivateDataSourceConnectNetworkToken(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         pdc_network_id: Optional[str] = None,
                                         region: Optional[str] = None,
                                         display_name: Optional[str] = None,
                                         expires_at: Optional[str] = None,
                                         name: Optional[str] = None)func NewPrivateDataSourceConnectNetworkToken(ctx *Context, name string, args PrivateDataSourceConnectNetworkTokenArgs, opts ...ResourceOption) (*PrivateDataSourceConnectNetworkToken, error)public PrivateDataSourceConnectNetworkToken(string name, PrivateDataSourceConnectNetworkTokenArgs args, CustomResourceOptions? opts = null)
public PrivateDataSourceConnectNetworkToken(String name, PrivateDataSourceConnectNetworkTokenArgs args)
public PrivateDataSourceConnectNetworkToken(String name, PrivateDataSourceConnectNetworkTokenArgs args, CustomResourceOptions options)
type: grafana:cloud:PrivateDataSourceConnectNetworkToken
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 PrivateDataSourceConnectNetworkTokenArgs
- 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 PrivateDataSourceConnectNetworkTokenArgs
- 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 PrivateDataSourceConnectNetworkTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PrivateDataSourceConnectNetworkTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PrivateDataSourceConnectNetworkTokenArgs
- 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 privateDataSourceConnectNetworkTokenResource = new Grafana.Cloud.PrivateDataSourceConnectNetworkToken("privateDataSourceConnectNetworkTokenResource", new()
{
    PdcNetworkId = "string",
    Region = "string",
    DisplayName = "string",
    ExpiresAt = "string",
    Name = "string",
});
example, err := cloud.NewPrivateDataSourceConnectNetworkToken(ctx, "privateDataSourceConnectNetworkTokenResource", &cloud.PrivateDataSourceConnectNetworkTokenArgs{
	PdcNetworkId: pulumi.String("string"),
	Region:       pulumi.String("string"),
	DisplayName:  pulumi.String("string"),
	ExpiresAt:    pulumi.String("string"),
	Name:         pulumi.String("string"),
})
var privateDataSourceConnectNetworkTokenResource = new PrivateDataSourceConnectNetworkToken("privateDataSourceConnectNetworkTokenResource", PrivateDataSourceConnectNetworkTokenArgs.builder()
    .pdcNetworkId("string")
    .region("string")
    .displayName("string")
    .expiresAt("string")
    .name("string")
    .build());
private_data_source_connect_network_token_resource = grafana.cloud.PrivateDataSourceConnectNetworkToken("privateDataSourceConnectNetworkTokenResource",
    pdc_network_id="string",
    region="string",
    display_name="string",
    expires_at="string",
    name="string")
const privateDataSourceConnectNetworkTokenResource = new grafana.cloud.PrivateDataSourceConnectNetworkToken("privateDataSourceConnectNetworkTokenResource", {
    pdcNetworkId: "string",
    region: "string",
    displayName: "string",
    expiresAt: "string",
    name: "string",
});
type: grafana:cloud:PrivateDataSourceConnectNetworkToken
properties:
    displayName: string
    expiresAt: string
    name: string
    pdcNetworkId: string
    region: string
PrivateDataSourceConnectNetworkToken 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 PrivateDataSourceConnectNetworkToken resource accepts the following input properties:
- PdcNetwork stringId 
- ID of the private data source network for which to create a token.
- Region string
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- DisplayName string
- Display name of the private data source network token. Defaults to the name.
- ExpiresAt string
- Expiration date of the private data source network token. Does not expire by default.
- Name string
- Name of the private data source network token.
- PdcNetwork stringId 
- ID of the private data source network for which to create a token.
- Region string
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- DisplayName string
- Display name of the private data source network token. Defaults to the name.
- ExpiresAt string
- Expiration date of the private data source network token. Does not expire by default.
- Name string
- Name of the private data source network token.
- pdcNetwork StringId 
- ID of the private data source network for which to create a token.
- region String
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- displayName String
- Display name of the private data source network token. Defaults to the name.
- expiresAt String
- Expiration date of the private data source network token. Does not expire by default.
- name String
- Name of the private data source network token.
- pdcNetwork stringId 
- ID of the private data source network for which to create a token.
- region string
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- displayName string
- Display name of the private data source network token. Defaults to the name.
- expiresAt string
- Expiration date of the private data source network token. Does not expire by default.
- name string
- Name of the private data source network token.
- pdc_network_ strid 
- ID of the private data source network for which to create a token.
- region str
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- display_name str
- Display name of the private data source network token. Defaults to the name.
- expires_at str
- Expiration date of the private data source network token. Does not expire by default.
- name str
- Name of the private data source network token.
- pdcNetwork StringId 
- ID of the private data source network for which to create a token.
- region String
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- displayName String
- Display name of the private data source network token. Defaults to the name.
- expiresAt String
- Expiration date of the private data source network token. Does not expire by default.
- name String
- Name of the private data source network token.
Outputs
All input properties are implicitly available as output properties. Additionally, the PrivateDataSourceConnectNetworkToken resource produces the following output properties:
- created_at str
- Creation date of the private data source network token.
- id str
- The provider-assigned unique ID for this managed resource.
- token str
- updated_at str
- Last update date of the private data source network token.
Look up Existing PrivateDataSourceConnectNetworkToken Resource
Get an existing PrivateDataSourceConnectNetworkToken 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?: PrivateDataSourceConnectNetworkTokenState, opts?: CustomResourceOptions): PrivateDataSourceConnectNetworkToken@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        display_name: Optional[str] = None,
        expires_at: Optional[str] = None,
        name: Optional[str] = None,
        pdc_network_id: Optional[str] = None,
        region: Optional[str] = None,
        token: Optional[str] = None,
        updated_at: Optional[str] = None) -> PrivateDataSourceConnectNetworkTokenfunc GetPrivateDataSourceConnectNetworkToken(ctx *Context, name string, id IDInput, state *PrivateDataSourceConnectNetworkTokenState, opts ...ResourceOption) (*PrivateDataSourceConnectNetworkToken, error)public static PrivateDataSourceConnectNetworkToken Get(string name, Input<string> id, PrivateDataSourceConnectNetworkTokenState? state, CustomResourceOptions? opts = null)public static PrivateDataSourceConnectNetworkToken get(String name, Output<String> id, PrivateDataSourceConnectNetworkTokenState state, CustomResourceOptions options)resources:  _:    type: grafana:cloud:PrivateDataSourceConnectNetworkToken    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.
- CreatedAt string
- Creation date of the private data source network token.
- DisplayName string
- Display name of the private data source network token. Defaults to the name.
- ExpiresAt string
- Expiration date of the private data source network token. Does not expire by default.
- Name string
- Name of the private data source network token.
- PdcNetwork stringId 
- ID of the private data source network for which to create a token.
- Region string
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- Token string
- UpdatedAt string
- Last update date of the private data source network token.
- CreatedAt string
- Creation date of the private data source network token.
- DisplayName string
- Display name of the private data source network token. Defaults to the name.
- ExpiresAt string
- Expiration date of the private data source network token. Does not expire by default.
- Name string
- Name of the private data source network token.
- PdcNetwork stringId 
- ID of the private data source network for which to create a token.
- Region string
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- Token string
- UpdatedAt string
- Last update date of the private data source network token.
- createdAt String
- Creation date of the private data source network token.
- displayName String
- Display name of the private data source network token. Defaults to the name.
- expiresAt String
- Expiration date of the private data source network token. Does not expire by default.
- name String
- Name of the private data source network token.
- pdcNetwork StringId 
- ID of the private data source network for which to create a token.
- region String
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- token String
- updatedAt String
- Last update date of the private data source network token.
- createdAt string
- Creation date of the private data source network token.
- displayName string
- Display name of the private data source network token. Defaults to the name.
- expiresAt string
- Expiration date of the private data source network token. Does not expire by default.
- name string
- Name of the private data source network token.
- pdcNetwork stringId 
- ID of the private data source network for which to create a token.
- region string
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- token string
- updatedAt string
- Last update date of the private data source network token.
- created_at str
- Creation date of the private data source network token.
- display_name str
- Display name of the private data source network token. Defaults to the name.
- expires_at str
- Expiration date of the private data source network token. Does not expire by default.
- name str
- Name of the private data source network token.
- pdc_network_ strid 
- ID of the private data source network for which to create a token.
- region str
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- token str
- updated_at str
- Last update date of the private data source network token.
- createdAt String
- Creation date of the private data source network token.
- displayName String
- Display name of the private data source network token. Defaults to the name.
- expiresAt String
- Expiration date of the private data source network token. Does not expire by default.
- name String
- Name of the private data source network token.
- pdcNetwork StringId 
- ID of the private data source network for which to create a token.
- region String
- Region of the private data source network. Should be set to the same region as the private data source network. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
- token String
- updatedAt String
- Last update date of the private data source network token.
Import
$ pulumi import grafana:cloud/privateDataSourceConnectNetworkToken:PrivateDataSourceConnectNetworkToken name "{{ region }}:{{ tokenId }}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the grafanaTerraform Provider.
