### Go Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Role resource in Go using neon.NewRole. ```go example, err := neon.NewRole(ctx, "roleResource", &neon.RoleArgs{ BranchId: pulumi.String("string"), ProjectId: pulumi.String("string"), Name: pulumi.String("string"), RoleId: pulumi.String("string"), }) ``` -------------------------------- ### Python Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Role resource in Python. ```python role_resource = neon.Role("roleResource", branch_id="string", project_id="string", name="string", role_id="string") ``` -------------------------------- ### Java Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Role resource in Java. ```java var roleResource = new Role("roleResource", RoleArgs.builder() .branchId("string") .projectId("string") .name("string") .roleId("string") .build()); ``` -------------------------------- ### Go Branch Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Example of creating a Branch resource using Go. ```go example, err := neon.NewBranch(ctx, "branchResource", &neon.BranchArgs{ ProjectId: pulumi.String("string"), Name: pulumi.String("string"), ParentId: pulumi.String("string"), ParentLsn: pulumi.String("string"), ParentTimestamp: pulumi.Float64(0), Protected: pulumi.String("string"), }) ``` -------------------------------- ### Go Database Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Example of creating a Neon Database resource in Go using placeholder values. ```go example, err := neon.NewDatabase(ctx, "databaseResource", &neon.DatabaseArgs{ BranchId: pulumi.String("string"), OwnerName: pulumi.String("string"), ProjectId: pulumi.String("string"), DatabaseId: pulumi.String("string"), Name: pulumi.String("string"), }) ``` -------------------------------- ### YAML Configuration Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/getbranchroles An example of how to configure the getBranchRoles function using YAML, specifying the function and its arguments. ```yaml fn::invoke: function: neon:index/getBranchRoles:getBranchRoles arguments: # arguments dictionary ``` -------------------------------- ### Pulumi.yaml Configuration Example (Go) Source: https://www.pulumi.com/registry/packages/neon Example Pulumi.yaml configuration file for a Go project using the Neon provider. ```yaml # Pulumi.yaml provider configuration file name: configuration-example runtime: go ``` -------------------------------- ### C# Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Role resource in C# with placeholder values. ```csharp var roleResource = new Neon.Role("roleResource", new() { BranchId = "string", ProjectId = "string", Name = "string", RoleId = "string", }); ``` -------------------------------- ### Java Database Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Example of creating a Neon Database resource in Java using placeholder values. ```java var databaseResource = new Database("databaseResource", DatabaseArgs.builder() .branchId("string") .ownerName("string") .projectId("string") .databaseId("string") .name("string") .build()); ``` -------------------------------- ### Python Database Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Example of creating a Neon Database resource in Python using placeholder values. ```python database_resource = neon.Database("databaseResource", branch_id="string", owner_name="string", project_id="string", database_id="string", name="string") ``` -------------------------------- ### TypeScript Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Role resource in TypeScript. ```typescript const roleResource = new neon.Role("roleResource", { branchId: "string", projectId: "string", name: "string", roleId: "string", }); ``` -------------------------------- ### Pulumi.yaml Configuration Example (.NET) Source: https://www.pulumi.com/registry/packages/neon Example Pulumi.yaml configuration file for a .NET project using the Neon provider. ```yaml # Pulumi.yaml provider configuration file name: configuration-example runtime: dotnet ``` -------------------------------- ### VpcEndpointRestriction Example (Python) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction A Python example for creating a VpcEndpointRestriction resource with various properties. ```python vpc_endpoint_restriction_resource = neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", label="string", project_id="string", vpc_endpoint_id="string", vpc_endpoint_restriction_id="string") ``` -------------------------------- ### Create Neon API Key in Python Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Example of creating a Neon API key resource using the Pulumi Neon provider in Python. Ensure the pulumi_neon package is installed. ```python import pulumi import pulumi_neon as neon example = neon.ApiKey("example", name="foo") ``` -------------------------------- ### Pulumi.yaml Configuration Example (Python) Source: https://www.pulumi.com/registry/packages/neon Example Pulumi.yaml configuration file for a Python project using the Neon provider. ```yaml # Pulumi.yaml provider configuration file name: configuration-example runtime: python ``` -------------------------------- ### C# Database Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Example of creating a Neon Database resource in C# using placeholder values. ```csharp var databaseResource = new Neon.Database("databaseResource", new() { BranchId = "string", OwnerName = "string", ProjectId = "string", DatabaseId = "string", Name = "string", }); ``` -------------------------------- ### Go Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Instantiate the ApiKey resource in Go using placeholder values. ```go example, err := neon.NewApiKey(ctx, "apiKeyResource", &neon.ApiKeyArgs{ Name: pulumi.String("string"), }) ``` -------------------------------- ### Pulumi.yaml Configuration Example (Java) Source: https://www.pulumi.com/registry/packages/neon Example Pulumi.yaml configuration file for a Java project using the Neon provider. ```yaml # Pulumi.yaml provider configuration file name: configuration-example runtime: java ``` -------------------------------- ### Create ProjectPermission (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Example of creating a ProjectPermission resource in Go. ```go example, err := neon.NewProjectPermission(ctx, "projectPermissionResource", &neon.ProjectPermissionArgs{ Grantee: pulumi.String("string"), ProjectId: pulumi.String("string"), }) ``` -------------------------------- ### Pulumi.yaml Configuration Example (YAML) Source: https://www.pulumi.com/registry/packages/neon Example Pulumi.yaml configuration file for a YAML project using the Neon provider. ```yaml # Pulumi.yaml provider configuration file name: configuration-example runtime: yaml ``` -------------------------------- ### Role Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Provides example code for creating a Role resource in various languages. ```APIDOC ## Role Constructor Example ### TypeScript ```typescript var roleResource = new Neon.Role("roleResource", new() { BranchId = "string", ProjectId = "string", Name = "string", RoleId = "string", }); ``` ### Python ```python example, err := neon.NewRole(ctx, "roleResource", &neon.RoleArgs{ BranchId: pulumi.String("string"), ProjectId: pulumi.String("string"), Name: pulumi.String("string"), RoleId: pulumi.String("string"), }) ``` ### HCL ```hcl resource "neon_role" "roleResource" { branch_id = "string" project_id = "string" name = "string" role_id = "string" } ``` ### Java ```java var roleResource = new Role("roleResource", RoleArgs.builder() .branchId("string") .projectId("string") .name("string") .roleId("string") .build()); ``` ### Python (Alternative) ```python role_resource = neon.Role("roleResource", branch_id="string", project_id="string", name="string", role_id="string") ``` ### TypeScript (Alternative) ```typescript const roleResource = new neon.Role("roleResource", { branchId: "string", projectId: "string", name: "string", roleId: "string", }); ``` ### YAML ```yaml type: neon:Role properties: branchId: string name: string projectId: string roleId: string ``` ``` -------------------------------- ### HCL Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of declaring a Role resource in HCL. ```hcl resource "neon_role" "roleResource" { branch_id = "string" project_id = "string" name = "string" role_id = "string" } ``` -------------------------------- ### Java Branch Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Example of creating a Branch resource using Java. ```java var branchResource = new Branch("branchResource", BranchArgs.builder() .projectId("string") .name("string") .parentId("string") .parentLsn("string") .parentTimestamp(0.0) .protected_("string") .build()); ``` -------------------------------- ### JavaScript Branch Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Example of creating a Branch resource using JavaScript. ```javascript const branchResource = new neon.Branch("branchResource", { projectId: "string", name: "string", parentId: "string", parentLsn: "string", parentTimestamp: 0, "protected": "string", }); ``` -------------------------------- ### Python Branch Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Example of creating a Branch resource using Python. ```python branch_resource = neon.Branch("branchResource", project_id="string", name="string", parent_id="string", parent_lsn="string", parent_timestamp=float(0), protected="string") ``` -------------------------------- ### VpcEndpointRestriction Example (C#) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction An example of instantiating a VpcEndpointRestriction resource in C# using placeholder values. ```csharp var vpcEndpointRestrictionResource = new Neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", new() { Label = "string", ProjectId = "string", VpcEndpointId = "string", VpcEndpointRestrictionId = "string", }); ``` -------------------------------- ### Pulumi.yaml Configuration Example (Node.js) Source: https://www.pulumi.com/registry/packages/neon Example Pulumi.yaml configuration file for a Node.js project using the Neon provider. ```yaml # Pulumi.yaml provider configuration file name: configuration-example runtime: nodejs ``` -------------------------------- ### TypeScript Database Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Example of creating a Neon Database resource in TypeScript using placeholder values. ```typescript const databaseResource = new neon.Database("databaseResource", { branchId: "string", ownerName: "string", projectId: "string", databaseId: "string", name: "string", }); ``` -------------------------------- ### Create ProjectPermission (Python) Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Example of creating a ProjectPermission resource in Python. ```python project_permission_resource = neon.ProjectPermission("projectPermissionResource", grantee="string", project_id="string") ``` -------------------------------- ### TypeScript Branch Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Example of creating a Branch resource using TypeScript. ```typescript var branchResource = new Neon.Branch("branchResource", new() { ProjectId = "string", Name = "string", ParentId = "string", ParentLsn = "string", ParentTimestamp = 0, Protected = "string", }); ``` -------------------------------- ### OrgApiKey Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/orgapikey Provides a concrete example of how to instantiate the OrgApiKey resource with placeholder values. ```typescript var orgApiKeyResource = new Neon.OrgApiKey("orgApiKeyResource", new() { OrgId = "string", Name = "string", ProjectId = "string", }); ``` ```go example, err := neon.NewOrgApiKey(ctx, "orgApiKeyResource", &neon.OrgApiKeyArgs{ OrgId: pulumi.String("string"), Name: pulumi.String("string"), ProjectId: pulumi.String("string"), }) ``` ```hcl resource "neon_orgapikey" "orgApiKeyResource" { org_id = "string" name = "string" project_id = "string" } ``` ```java var orgApiKeyResource = new OrgApiKey("orgApiKeyResource", OrgApiKeyArgs.builder() .orgId("string") .name("string") .projectId("string") .build()); ``` ```python org_api_key_resource = neon.OrgApiKey("orgApiKeyResource", org_id="string", name="string", project_id="string") ``` ```typescript const orgApiKeyResource = new neon.OrgApiKey("orgApiKeyResource", { orgId: "string", name: "string", projectId: "string", }); ``` ```yaml type: neon:OrgApiKey properties: name: string orgId: string projectId: string ``` -------------------------------- ### Python Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Instantiate the ApiKey resource in Python using placeholder values. ```python api_key_resource = neon.ApiKey("apiKeyResource", name="string") ``` -------------------------------- ### VpcEndpointRestriction Example (Java) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction An example of creating a VpcEndpointRestriction resource in Java, utilizing a builder pattern for arguments. ```java var vpcEndpointRestrictionResource = new VpcEndpointRestriction("vpcEndpointRestrictionResource", VpcEndpointRestrictionArgs.builder() .label("string") .projectId("string") .vpcEndpointId("string") .vpcEndpointRestrictionId("string") .build()); ``` -------------------------------- ### Java Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Instantiate the ApiKey resource in Java using placeholder values. ```java var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder() .name("string") .build()); ``` -------------------------------- ### Create ProjectPermission (Java) Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Example of creating a ProjectPermission resource in Java. ```java var projectPermissionResource = new ProjectPermission("projectPermissionResource", ProjectPermissionArgs.builder() .grantee("string") .projectId("string") .build()); ``` -------------------------------- ### VpcEndpointRestriction Example (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction A Go code snippet demonstrating how to create a VpcEndpointRestriction resource with specified arguments. ```go example, err := neon.NewVpcEndpointRestriction(ctx, "vpcEndpointRestrictionResource", &neon.VpcEndpointRestrictionArgs{ Label: pulumi.String("string"), ProjectId: pulumi.String("string"), VpcEndpointId: pulumi.String("string"), VpcEndpointRestrictionId: pulumi.String("string"), }) ``` -------------------------------- ### Create Neon JwksUrl Resource (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/jwksurl Example of creating a Neon JwksUrl resource using Go with placeholder values. ```go example, err := neon.NewJwksUrl(ctx, "jwksUrlResource", &neon.JwksUrlArgs{ JwksUrl: pulumi.String("string"), ProjectId: pulumi.String("string"), ProviderName: pulumi.String("string"), RoleNames: pulumi.StringArray{ pulumi.String("string"), }, BranchId: pulumi.String("string"), JwksUrlId: pulumi.String("string"), JwtAudience: pulumi.String("string"), }) ``` -------------------------------- ### HCL Database Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Example of declaring a Neon Database resource in HCL using placeholder values. ```hcl resource "neon_database" "databaseResource" { branch_id = "string" owner_name = "string" project_id = "string" database_id = "string" name = "string" } ``` -------------------------------- ### C# Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Instantiate the ApiKey resource in C# using placeholder values. ```csharp var apiKeyResource = new Neon.ApiKey("apiKeyResource", new() { Name = "string", }); ``` -------------------------------- ### VpcEndpointRestriction Example (HCL) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction Shows how to declare and configure a VpcEndpointRestriction resource using HCL syntax. ```hcl resource "neon_vpcendpointrestriction" "vpcEndpointRestrictionResource" { label = "string" project_id = "string" vpc_endpoint_id = "string" vpc_endpoint_restriction_id = "string" } ``` -------------------------------- ### Instantiate VpcEndpointAssignment in Java Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointassignment Example of instantiating the VpcEndpointAssignment resource using Java. This requires the Neon SDK and proper class instantiation. ```java var vpcEndpointAssignmentResource = new VpcEndpointAssignment("vpcEndpointAssignmentResource", VpcEndpointAssignmentArgs.builder() .label("string") .orgId("string") .regionId("string") .vpcEndpointId("string") .vpcEndpointAssignmentId("string") .build()); ``` -------------------------------- ### JavaScript Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Instantiate the ApiKey resource in JavaScript using placeholder values. ```javascript const apiKeyResource = new neon.ApiKey("apiKeyResource", {name: "string"}); ``` -------------------------------- ### Instantiate VpcEndpointAssignment in C# Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointassignment Example of how to instantiate the VpcEndpointAssignment resource using C#. This requires the Neon SDK and appropriate using statements. ```csharp var vpcEndpointAssignmentResource = new Neon.VpcEndpointAssignment("vpcEndpointAssignmentResource", new(){ Label = "string", OrgId = "string", RegionId = "string", VpcEndpointId = "string", VpcEndpointAssignmentId = "string", }); ``` -------------------------------- ### Create ProjectPermission (C#) Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Example of creating a ProjectPermission resource in C#. ```csharp var projectPermissionResource = new Neon.ProjectPermission("projectPermissionResource", new() { Grantee = "string", ProjectId = "string", }); ``` -------------------------------- ### Instantiate VpcEndpointAssignment in Python Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointassignment Example of creating a VpcEndpointAssignment resource in Python. This requires importing the neon package and pulumi. ```python example, err := neon.NewVpcEndpointAssignment(ctx, "vpcEndpointAssignmentResource", &neon.VpcEndpointAssignmentArgs{ Label: pulumi.String("string"), OrgId: pulumi.String("string"), RegionId: pulumi.String("string"), VpcEndpointId: pulumi.String("string"), VpcEndpointAssignmentId: pulumi.String("string"), }) ``` -------------------------------- ### YAML OrgApiKey Configuration Source: https://www.pulumi.com/registry/packages/neon/api-docs/orgapikey Configure an OrgApiKey resource in YAML format. This example shows how to specify the resource type and use a 'get' block with an ID. ```yaml resources: _: type: neon:OrgApiKey get: id: ${id} ``` -------------------------------- ### VpcEndpointRestriction Example (TypeScript) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction Demonstrates the instantiation of a VpcEndpointRestriction resource in TypeScript. ```typescript const vpcEndpointRestrictionResource = new neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", { label: "string", projectId: "string", vpcEndpointId: "string", vpcEndpointRestrictionId: "string", }); ``` -------------------------------- ### HCL Data Source Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/getbranchroles Demonstrates the usage of the neon_getbranchroles data source in HCL for fetching branch roles. ```hcl data "neon_getbranchroles" "name" { # arguments } ``` -------------------------------- ### Create Neon API Key in TypeScript Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Example of creating a Neon API key resource using the Pulumi Neon provider in TypeScript. Ensure the @pulumi/neon package is installed. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as neon from "@pulumi/neon"; const example = new neon.ApiKey("example", {name: "foo"}); ``` -------------------------------- ### Create Neon JwksUrl Resource (Java) Source: https://www.pulumi.com/registry/packages/neon/api-docs/jwksurl Example of creating a Neon JwksUrl resource using Java with placeholder values. ```java var jwksUrlResource = new JwksUrl("jwksUrlResource", JwksUrlArgs.builder() .jwksUrl("string") .projectId("string") .providerName("string") .roleNames("string") .branchId("string") .jwksUrlId("string") .jwtAudience("string") .build()); ``` -------------------------------- ### Provider Constructor Syntax Source: https://www.pulumi.com/registry/packages/neon/api-docs/provider Demonstrates the constructor syntax for creating a Provider resource in Go, including context and resource options. ```go func NewProvider(ctx *Context, name string, args *ProviderArgs, opts ...ResourceOption) (*Provider, error) ``` -------------------------------- ### Create Neon JwksUrl Resource (C#) Source: https://www.pulumi.com/registry/packages/neon/api-docs/jwksurl Example of creating a Neon JwksUrl resource using C# with placeholder values. ```csharp var jwksUrlResource = new Neon.JwksUrl("jwksUrlResource", new() { JwksUrl = "string", ProjectId = "string", ProviderName = "string", RoleNames = new[] { "string", }, BranchId = "string", JwksUrlId = "string", JwtAudience = "string", }); ``` -------------------------------- ### Create Neon Project Resource (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/project Instantiate a Neon Project resource with placeholder values for all input properties using the Go SDK. Ensure all required properties are provided. ```go example, err := neon.NewProject(ctx, "projectResource", &neon.ProjectArgs{ AllowedIps: pulumi.StringArray{ pulumi.String("string"), }, AllowedIpsProtectedBranchesOnly: pulumi.String("string"), BlockPublicConnections: pulumi.String("string"), BlockVpcConnections: pulumi.String("string"), Branch: &neon.ProjectBranchArgs{ DatabaseName: pulumi.String("string"), Id: pulumi.String("string"), Name: pulumi.String("string"), RoleName: pulumi.String("string"), }, ComputeProvisioner: pulumi.String("string"), DefaultEndpointSettings: &neon.ProjectDefaultEndpointSettingsArgs{ AutoscalingLimitMaxCu: pulumi.Float64(0), AutoscalingLimitMinCu: pulumi.Float64(0), Id: pulumi.String("string"), SuspendTimeoutSeconds: pulumi.Float64(0), }, EnableLogicalReplication: pulumi.String("string"), HistoryRetentionSeconds: pulumi.Float64(0), MaintenanceWindow: &neon.ProjectMaintenanceWindowArgs{ EndTime: pulumi.String("string"), StartTime: pulumi.String("string"), Weekdays: pulumi.Float64Array{ pulumi.Float64(0), }, }, Name: pulumi.String("string"), OrgId: pulumi.String("string"), PgVersion: pulumi.Float64(0), Quota: &neon.ProjectQuotaArgs{ ActiveTimeSeconds: pulumi.Float64(0), ComputeTimeSeconds: pulumi.Float64(0), DataTransferBytes: pulumi.Float64(0), LogicalSizeBytes: pulumi.Float64(0), WrittenDataBytes: pulumi.Float64(0), }, RegionId: pulumi.String("string"), StorePassword: pulumi.String("string"), }) ``` -------------------------------- ### HCL Branch Resource Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Example of declaring a Branch resource using HCL. ```hcl resource "neon_branch" "branchResource" { project_id = "string" name = "string" parent_id = "string" parent_lsn = "string" parent_timestamp = 0 protected = "string" } ``` -------------------------------- ### Create a ProjectPermission Resource in C# Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission This C# example demonstrates how to grant project access. Provide the project ID and the grantee's email to set permissions. ```csharp using System.Collections.Generic; using System.Linq; using Pulumi; using Neon = Pulumi.Neon; return await Deployment.RunAsync(() => { var example = new Neon.Project("example", new() { Name = "foo", }); // grant project access to the user with the email foo@bar.qux var share = new Neon.ProjectPermission("share", new() { ProjectId = example.Id, Grantee = "foo@bar.qux", }); }); ``` -------------------------------- ### Go Database Constructor Syntax Source: https://www.pulumi.com/registry/packages/neon/api-docs/database Shows the constructor syntax for creating a Database resource in Go. ```go func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error) ``` -------------------------------- ### Go Project Constructor Source: https://www.pulumi.com/registry/packages/neon/api-docs/project Use this function to create a new Neon Project resource in Go. It requires a context, name, and project arguments, and accepts optional resource options. ```go func NewProject(ctx *Context, name string, args *ProjectArgs, opts ...ResourceOption) (*Project, error) ``` -------------------------------- ### Create Neon API Key in Go Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Example of creating a Neon API key resource using the Pulumi Neon provider in Go. Ensure the necessary Pulumi SDKs are imported. ```go package main import ( "github.com/pulumi/pulumi-terraform-provider/sdks/go/neon/neon" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := neon.NewApiKey(ctx, "example", &neon.ApiKeyArgs{ Name: pulumi.String("foo"), }) if err != nil { return err } return nil }) } ``` -------------------------------- ### Create a Neon Project Resource (Python) Source: https://www.pulumi.com/registry/packages/neon/api-docs/project Example of creating a Neon Project resource using the Pulumi Python SDK. This snippet demonstrates setting various project properties like allowed IPs, branch configuration, and default endpoint settings. ```python project_resource = neon.Project("projectResource", allowed_ips=["string"], allowed_ips_protected_branches_only="string", block_public_connections="string", block_vpc_connections="string", branch={ "database_name": "string", "id": "string", "name": "string", "role_name": "string", }, compute_provisioner="string", default_endpoint_settings={ "autoscaling_limit_max_cu": float(0), "autoscaling_limit_min_cu": float(0), "id": "string", "suspend_timeout_seconds": float(0), }, enable_logical_replication="string", history_retention_seconds=float(0), maintenance_window={ "end_time": "string", "start_time": "string", "weekdays": [float(0)], }, name="string", org_id="string", pg_version=float(0), quota={ "active_time_seconds": float(0), "compute_time_seconds": float(0), "data_transfer_bytes": float(0), "logical_size_bytes": float(0), "written_data_bytes": float(0), }, region_id="string", store_password="string") ``` -------------------------------- ### Instantiate VpcEndpointAssignment in Pulumi Go Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointassignment Example of creating a VpcEndpointAssignment resource in Go using Pulumi. Ensure the Neon Pulumi provider is configured. ```go vpc_endpoint_assignment_resource = neon.NewVpcEndpointAssignment("vpcEndpointAssignmentResource", neon.VpcEndpointAssignmentArgs{ Label: pulumi.String("string"), OrgId: pulumi.String("string"), RegionId: pulumi.String("string"), VpcEndpointId: pulumi.String("string"), VpcEndpointAssignmentId: pulumi.String("string"), }) ``` -------------------------------- ### Create Neon Endpoint Resource (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/endpoint Example of creating a Neon Endpoint resource using Go. All input properties are represented with placeholder values. ```go example, err := neon.NewEndpoint(ctx, "endpointResource", &neon.EndpointArgs{ BranchId: pulumi.String("string"), ProjectId: pulumi.String("string"), AutoscalingLimitMaxCu: pulumi.Float64(0), AutoscalingLimitMinCu: pulumi.Float64(0), ComputeProvisioner: pulumi.String("string"), Disabled: pulumi.Bool(false), PgSettings: pulumi.StringMap{ "string": pulumi.String("string"), }, PoolerEnabled: pulumi.Bool(false), PoolerMode: pulumi.String("string"), RegionId: pulumi.String("string"), SuspendTimeoutSeconds: pulumi.Float64(0), Type: pulumi.String("string"), }) ``` -------------------------------- ### Create a Neon Role (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Neon Role resource using the Pulumi Go SDK. This snippet includes the necessary package imports and the structure for defining Pulumi resources. ```go package main import ( "github.com/pulumi/pulumi-terraform-provider/sdks/go/neon/neon" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { example, err := neon.NewProject(ctx, "example", &neon.ProjectArgs{ Name: pulumi.String("foo"), }) if err != nil { return err } exampleBranch, err := neon.NewBranch(ctx, "example", &neon.BranchArgs{ ProjectId: example.ID(), Name: pulumi.String("bar"), }) if err != nil { return err } _, err = neon.NewRole(ctx, "example", &neon.RoleArgs{ ProjectId: example.ID(), BranchId: exampleBranch.ID(), Name: pulumi.String("qux"), }) if err != nil { return err } return nil }) } ``` -------------------------------- ### VpcEndpointRestriction Constructor Example Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction Example code for creating a VpcEndpointRestriction resource in TypeScript, Go, HCL, Java, Python, and YAML. ```APIDOC ## VpcEndpointRestriction Constructor Example ### Description This section provides example code for instantiating the `VpcEndpointRestriction` resource in various languages. ### TypeScript ```typescript var vpcEndpointRestrictionResource = new Neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", new() { Label = "string", ProjectId = "string", VpcEndpointId = "string", VpcEndpointRestrictionId = "string", }); ``` ### Go ```go example, err := neon.NewVpcEndpointRestriction(ctx, "vpcEndpointRestrictionResource", &neon.VpcEndpointRestrictionArgs{ Label: pulumi.String("string"), ProjectId: pulumi.String("string"), VpcEndpointId: pulumi.String("string"), VpcEndpointRestrictionId: pulumi.String("string"), }) ``` ### HCL ```hcl resource "neon_vpcendpointrestriction" "vpcEndpointRestrictionResource" { label = "string" project_id = "string" vpc_endpoint_id = "string" vpc_endpoint_restriction_id = "string" } ``` ### Java ```java var vpcEndpointRestrictionResource = new VpcEndpointRestriction("vpcEndpointRestrictionResource", VpcEndpointRestrictionArgs.builder() .label("string") .projectId("string") .vpcEndpointId("string") .vpcEndpointRestrictionId("string") .build()); ``` ### Python ```python vpc_endpoint_restriction_resource = neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", label="string", project_id="string", vpc_endpoint_id="string", vpc_endpoint_restriction_id="string") ``` ### YAML ```yaml const vpcEndpointRestrictionResource = new neon.VpcEndpointRestriction("vpcEndpointRestrictionResource", { label: "string", projectId: "string", vpcEndpointId: "string", vpcEndpointRestrictionId: "string", }); ``` ``` -------------------------------- ### get Source: https://www.pulumi.com/registry/packages/neon/api-docs/branch Get an existing Branch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup. ```APIDOC ## get Branch ### Description Get an existing Branch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup. ### Method GET (or equivalent SDK method) ### Parameters #### Path Parameters - **name** (string) - Required - The unique name of the resulting resource. - **id** (string) - Required - The _unique_ provider ID of the resource to lookup. #### Query Parameters - **logicalSize** (number) - Optional - Branch logical size in MB. - **name** (string) - Optional - Branch name. - **parentId** (string) - Optional - ID of the branch to check out. - **parentLsn** (string) - Optional - Log Sequence Number (LSN) horizon for the data to be present in the new branch. - **parentTimestamp** (number) - Optional - Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch. - **projectId** (string) - Optional - Project ID. - **protected** (string) - Optional - Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected. #### Request Body None ### Response #### Success Response (200) - **Branch** (object) - The state of the Branch resource. #### Response Example { "example": "Branch object details" } ``` -------------------------------- ### Terraform Import Command for ProjectPermission Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Command-line example for importing a ProjectPermission resource using Terraform. Replace the example ID with the actual resource identifier. ```bash $ pulumi import neon:index/projectPermission:ProjectPermission example "shiny-cell-31746257/12345678-1234-1234-1234-123456789abc" ``` -------------------------------- ### Create Neon Project Resource (C#) Source: https://www.pulumi.com/registry/packages/neon/api-docs/project Instantiate a Neon Project resource with placeholder values for all input properties using the C# SDK. Ensure all required properties are provided. ```csharp var projectResource = new Neon.Project("projectResource", new() { AllowedIps = new[] { "string", }, AllowedIpsProtectedBranchesOnly = "string", BlockPublicConnections = "string", BlockVpcConnections = "string", Branch = new Neon.Inputs.ProjectBranchArgs { DatabaseName = "string", Id = "string", Name = "string", RoleName = "string", }, ComputeProvisioner = "string", DefaultEndpointSettings = new Neon.Inputs.ProjectDefaultEndpointSettingsArgs { AutoscalingLimitMaxCu = 0, AutoscalingLimitMinCu = 0, Id = "string", SuspendTimeoutSeconds = 0, }, EnableLogicalReplication = "string", HistoryRetentionSeconds = 0, MaintenanceWindow = new Neon.Inputs.ProjectMaintenanceWindowArgs { EndTime = "string", StartTime = "string", Weekdays = new[] { 0, }, }, Name = "string", OrgId = "string", PgVersion = 0, Quota = new Neon.Inputs.ProjectQuotaArgs { ActiveTimeSeconds = 0, ComputeTimeSeconds = 0, DataTransferBytes = 0, LogicalSizeBytes = 0, WrittenDataBytes = 0, }, RegionId = "string", StorePassword = "string", }); ``` -------------------------------- ### Java ProjectPermission Get Method Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Use this method to get an existing ProjectPermission resource in Java. It requires the resource name, ID, state, and options. ```java public static ProjectPermission get(String name, Output id, ProjectPermissionState state, CustomResourceOptions options) ``` -------------------------------- ### Java ApiKey Get Method Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Get an existing ApiKey resource in Java. This static method requires the resource name, ID, state, and options. ```java public static ApiKey get(String name, Output id, ApiKeyState state, CustomResourceOptions options) ``` -------------------------------- ### Neon VpcEndpointAssignment Constructor Syntax (Go) Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointassignment Shows the constructor syntax for creating a VpcEndpointAssignment resource in Go. ```go func NewVpcEndpointAssignment(ctx *Context, name string, args VpcEndpointAssignmentArgs, opts ...ResourceOption) (*VpcEndpointAssignment, error) ``` -------------------------------- ### C# ProjectPermission Get Method Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Use this method to get an existing ProjectPermission resource in C#. It requires the resource name, ID, and optional state and options. ```csharp public static ProjectPermission Get(string name, Input id, ProjectPermissionState? state, CustomResourceOptions? opts = null) ``` -------------------------------- ### TypeScript ProjectPermission Get Method Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Use this method to get an existing ProjectPermission resource in TypeScript. It requires the resource name, ID, and optional state and options. ```typescript public static get(name: string, id: Input, state?: ProjectPermissionState, opts?: CustomResourceOptions): ProjectPermission ``` -------------------------------- ### Create a Neon Database Source: https://www.pulumi.com/registry/packages/neon/schema.json Example of creating a Neon database using the Pulumi Neon provider. It shows the instantiation of Project, Branch, Role, and Database resources. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as neon from "@pulumi/neon"; const example = new neon.Project("example", {name: "foo"}); const exampleBranch = new neon.Branch("example", { projectId: example.id, name: "bar", }); const exampleRole = new neon.Role("example", { projectId: example.id, branchId: exampleBranch.id, name: "qux", }); const exampleDatabase = new neon.Database("example", { projectId: example.id, branchId: exampleBranch.id, name: "qux", ownerName: exampleRole.name, }); ``` ```python import pulumi import pulumi_neon as neon example = neon.Project("example", name="foo") example_branch = neon.Branch("example", project_id=example.id, name="bar") example_role = neon.Role("example", project_id=example.id, branch_id=example_branch.id, name="qux") example_database = neon.Database("example", project_id=example.id, branch_id=example_branch.id, name="qux", owner_name=example_role.name) ``` ```csharp using System.Collections.Generic; using System.Linq; using Pulumi; using Neon = Pulumi.Neon; return await Deployment.RunAsync(() => { var example = new Neon.Project("example", new() { Name = "foo", }); var exampleBranch = new Neon.Branch("example", new() { ProjectId = example.Id, Name = "bar", }); var exampleRole = new Neon.Role("example", new() { ProjectId = example.Id, BranchId = exampleBranch.Id, Name = "qux", }); var exampleDatabase = new Neon.Database("example", new() { ProjectId = example.Id, BranchId = exampleBranch.Id, Name = "qux", OwnerName = exampleRole.Name, }); }); ``` -------------------------------- ### Python Project Get Method Source: https://www.pulumi.com/registry/packages/neon/api-docs/project This Python method allows you to get an existing Project resource. It takes the resource name, ID, and numerous optional arguments for configuration. ```python @staticmethod def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, allowed_ips: Optional[Sequence[str]] = None, allowed_ips_protected_branches_only: Optional[str] = None, block_public_connections: Optional[str] = None, block_vpc_connections: Optional[str] = None, branch: Optional[ProjectBranchArgs] = None, compute_provisioner: Optional[str] = None, connection_uri: Optional[str] = None, connection_uri_pooler: Optional[str] = None, database_host: Optional[str] = None, database_host_pooler: Optional[str] = None, database_name: Optional[str] = None, database_password: Optional[str] = None, database_user: Optional[str] = None, default_branch_id: Optional[str] = None, default_endpoint_id: Optional[str] = None, default_endpoint_settings: Optional[ProjectDefaultEndpointSettingsArgs] = None, enable_logical_replication: Optional[str] = None, history_retention_seconds: Optional[float] = None, maintenance_window: Optional[ProjectMaintenanceWindowArgs] = None, name: Optional[str] = None, org_id: Optional[str] = None, pg_version: Optional[float] = None, quota: Optional[ProjectQuotaArgs] = None, region_id: Optional[str] = None, store_password: Optional[str] = None) -> Project ``` -------------------------------- ### Java VpcEndpointRestriction Get Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction Use this static method to get an existing VpcEndpointRestriction resource's state in Java. It requires the resource name, ID, state, and options. ```java public static VpcEndpointRestriction get(String name, Output id, VpcEndpointRestrictionState state, CustomResourceOptions options) ``` -------------------------------- ### Create a Neon Project, Branch, and Endpoint Source: https://www.pulumi.com/registry/packages/neon/schema.json This snippet shows how to provision a Neon project, create a branch within it, and then set up a read-write endpoint for that branch. It's useful for setting up new database environments. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as neon from "@pulumi/neon"; const example = new neon.Project("example", {name: "foo"}); const exampleBranch = new neon.Branch("example", { projectId: example.id, name: "bar", }); const exampleEndpoint = new neon.Endpoint("example", { projectId: example.id, branchId: exampleBranch.id, type: "read_write", }); ``` ```python import pulumi import pulumi_neon as neon example = neon.Project("example", name="foo") example_branch = neon.Branch("example", project_id=example.id, name="bar") example_endpoint = neon.Endpoint("example", project_id=example.id, branch_id=example_branch.id, type="read_write") ``` ```csharp using System.Collections.Generic; using System.Linq; using Pulumi; using Neon = Pulumi.Neon; return await Deployment.RunAsync(() => { var example = new Neon.Project("example", new() { Name = "foo", }); var exampleBranch = new Neon.Branch("example", new() { ProjectId = example.Id, Name = "bar", }); var exampleEndpoint = new Neon.Endpoint("example", new() { ProjectId = example.Id, BranchId = exampleBranch.Id, Type = "read_write", }); }); ``` ```go package main import ( "github.com/pulumi/pulumi-terraform-provider/sdks/go/neon/neon" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { example, err := neon.NewProject(ctx, "example", &neon.ProjectArgs{ Name: pulumi.String("foo"), }) if err != nil { return err } exampleBranch, err := neon.NewBranch(ctx, "example", &neon.BranchArgs{ ProjectId: example.ID(), Name: pulumi.String("bar"), }) if err != nil { return err } _, err = neon.NewEndpoint(ctx, "example", &neon.EndpointArgs{ ProjectId: example.ID(), BranchId: exampleBranch.ID(), Type: pulumi.String("read_write"), }) if err != nil { return err } return nil }) } ``` ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.neon.Project; import com.pulumi.neon.ProjectArgs; import com.pulumi.neon.Branch; import com.pulumi.neon.BranchArgs; import com.pulumi.neon.Endpoint; import com.pulumi.neon.EndpointArgs; 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 example = new Project("example", ProjectArgs.builder() .name("foo") .build()); var exampleBranch = new Branch("exampleBranch", BranchArgs.builder() .projectId(example.id()) .name("bar") .build()); var exampleEndpoint = new Endpoint("exampleEndpoint", EndpointArgs.builder() .projectId(example.id()) .branchId(exampleBranch.id()) .type("read_write") .build()); } } ``` ```yaml resources: example: type: neon:Project properties: name: foo exampleBranch: type: neon:Branch name: example properties: projectId: ${example.id} name: bar exampleEndpoint: type: neon:Endpoint name: example properties: projectId: ${example.id} branchId: ${exampleBranch.id} type: read_write ``` -------------------------------- ### TypeScript VpcEndpointRestriction Get Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction Use this method to get an existing VpcEndpointRestriction resource's state in TypeScript. It requires the resource name, ID, and optional state and options. ```typescript public static get(name: string, id: Input, state?: VpcEndpointRestrictionState, opts?: CustomResourceOptions): VpcEndpointRestriction ``` -------------------------------- ### Go ProjectPermission Get Function Source: https://www.pulumi.com/registry/packages/neon/api-docs/projectpermission Use this function to get an existing ProjectPermission resource in Go. It requires a context, name, ID, optional state, and resource options. ```go func GetProjectPermission(ctx *Context, name string, id IDInput, state *ProjectPermissionState, opts ...ResourceOption) (*ProjectPermission, error) ``` -------------------------------- ### Go ApiKey Get Function Source: https://www.pulumi.com/registry/packages/neon/api-docs/apikey Use this function to get an existing ApiKey resource in Go. It requires a context, name, ID, state, and optional resource options. ```go func GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error) ``` -------------------------------- ### Create a Neon Role (C#) Source: https://www.pulumi.com/registry/packages/neon/api-docs/role Example of creating a Neon Role resource using the Pulumi C# SDK. This demonstrates the asynchronous deployment pattern and resource definition. ```csharp using System.Collections.Generic; using System.Linq; using Pulumi; using Neon = Pulumi.Neon; return await Deployment.RunAsync(() => { var example = new Neon.Project("example", new() { Name = "foo", }); var exampleBranch = new Neon.Branch("example", new() { ProjectId = example.Id, Name = "bar", }); var exampleRole = new Neon.Role("example", new() { ProjectId = example.Id, BranchId = exampleBranch.Id, Name = "qux", }); }); ``` -------------------------------- ### Go VpcEndpointRestriction Get Source: https://www.pulumi.com/registry/packages/neon/api-docs/vpcendpointrestriction Use this function to get an existing VpcEndpointRestriction resource's state in Go. It requires a context, resource name, ID, state, and variadic resource options. ```go func GetVpcEndpointRestriction(ctx *Context, name string, id IDInput, state *VpcEndpointRestrictionState, opts ...ResourceOption) (*VpcEndpointRestriction, error) ```