Registering a Resource with Formal.
Create Resource Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Resource(name: string, args: ResourceArgs, opts?: CustomResourceOptions);@overload
def Resource(resource_name: str,
args: ResourceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Resource(resource_name: str,
opts: Optional[ResourceOptions] = None,
hostname: Optional[str] = None,
port: Optional[int] = None,
technology: Optional[str] = None,
aliases: Optional[Sequence[str]] = None,
environment: Optional[str] = None,
name: Optional[str] = None,
space_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
technology_provider: Optional[str] = None,
termination_protection: Optional[bool] = None)func NewResource(ctx *Context, name string, args ResourceArgs, opts ...ResourceOption) (*Resource, error)public Resource(string name, ResourceArgs args, CustomResourceOptions? opts = null)
public Resource(String name, ResourceArgs args)
public Resource(String name, ResourceArgs args, CustomResourceOptions options)
type: formal:Resource
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 ResourceArgs
- 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 ResourceArgs
- 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 ResourceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ResourceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ResourceArgs
- 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 resourceResource = new Pulumi.Resource("resourceResource", new()
{
Hostname = "string",
Port = 0,
Technology = "string",
Aliases = new[]
{
"string",
},
Name = "string",
SpaceId = "string",
Tags =
{
{ "string", "string" },
},
TechnologyProvider = "string",
TerminationProtection = false,
});
example, err := formal.NewResource(ctx, "resourceResource", &formal.ResourceArgs{
Hostname: pulumi.String("string"),
Port: pulumi.Int(0),
Technology: pulumi.String("string"),
Aliases: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
SpaceId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
TechnologyProvider: pulumi.String("string"),
TerminationProtection: pulumi.Bool(false),
})
var resourceResource = new Resource("resourceResource", ResourceArgs.builder()
.hostname("string")
.port(0)
.technology("string")
.aliases("string")
.name("string")
.spaceId("string")
.tags(Map.of("string", "string"))
.technologyProvider("string")
.terminationProtection(false)
.build());
resource_resource = formal.Resource("resourceResource",
hostname="string",
port=0,
technology="string",
aliases=["string"],
name="string",
space_id="string",
tags={
"string": "string",
},
technology_provider="string",
termination_protection=False)
const resourceResource = new formal.Resource("resourceResource", {
hostname: "string",
port: 0,
technology: "string",
aliases: ["string"],
name: "string",
spaceId: "string",
tags: {
string: "string",
},
technologyProvider: "string",
terminationProtection: false,
});
type: formal:Resource
properties:
aliases:
- string
hostname: string
name: string
port: 0
spaceId: string
tags:
string: string
technology: string
technologyProvider: string
terminationProtection: false
Resource 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 Resource resource accepts the following input properties:
- Hostname string
- Hostname of the Resource.
- Port int
- The port your Resource is listening on.
- Technology string
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - Aliases List<string>
- Aliases to apply to the Resource.
- Environment string
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- Name string
- Friendly name for the Resource.
- Space
Id string - The ID of the Space to create the Resource in.
- Dictionary<string, string>
- Tags to apply to the Resource.
- Technology
Provider string - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - Termination
Protection bool - If set to true, the Resource cannot be deleted.
- Hostname string
- Hostname of the Resource.
- Port int
- The port your Resource is listening on.
- Technology string
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - Aliases []string
- Aliases to apply to the Resource.
- Environment string
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- Name string
- Friendly name for the Resource.
- Space
Id string - The ID of the Space to create the Resource in.
- map[string]string
- Tags to apply to the Resource.
- Technology
Provider string - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - Termination
Protection bool - If set to true, the Resource cannot be deleted.
- hostname String
- Hostname of the Resource.
- port Integer
- The port your Resource is listening on.
- technology String
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - aliases List<String>
- Aliases to apply to the Resource.
- environment String
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- name String
- Friendly name for the Resource.
- space
Id String - The ID of the Space to create the Resource in.
- Map<String,String>
- Tags to apply to the Resource.
- technology
Provider String - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination
Protection Boolean - If set to true, the Resource cannot be deleted.
- hostname string
- Hostname of the Resource.
- port number
- The port your Resource is listening on.
- technology string
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - aliases string[]
- Aliases to apply to the Resource.
- environment string
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- name string
- Friendly name for the Resource.
- space
Id string - The ID of the Space to create the Resource in.
- {[key: string]: string}
- Tags to apply to the Resource.
- technology
Provider string - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination
Protection boolean - If set to true, the Resource cannot be deleted.
- hostname str
- Hostname of the Resource.
- port int
- The port your Resource is listening on.
- technology str
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - aliases Sequence[str]
- Aliases to apply to the Resource.
- environment str
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- name str
- Friendly name for the Resource.
- space_
id str - The ID of the Space to create the Resource in.
- Mapping[str, str]
- Tags to apply to the Resource.
- technology_
provider str - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination_
protection bool - If set to true, the Resource cannot be deleted.
- hostname String
- Hostname of the Resource.
- port Number
- The port your Resource is listening on.
- technology String
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - aliases List<String>
- Aliases to apply to the Resource.
- environment String
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- name String
- Friendly name for the Resource.
- space
Id String - The ID of the Space to create the Resource in.
- Map<String>
- Tags to apply to the Resource.
- technology
Provider String - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination
Protection Boolean - If set to true, the Resource cannot be deleted.
Outputs
All input properties are implicitly available as output properties. Additionally, the Resource resource produces the following output properties:
- created_
at int - Creation time of the Resource.
- id str
- The provider-assigned unique ID for this managed resource.
Look up Existing Resource Resource
Get an existing Resource 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?: ResourceState, opts?: CustomResourceOptions): Resource@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
aliases: Optional[Sequence[str]] = None,
created_at: Optional[int] = None,
environment: Optional[str] = None,
hostname: Optional[str] = None,
name: Optional[str] = None,
port: Optional[int] = None,
space_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
technology: Optional[str] = None,
technology_provider: Optional[str] = None,
termination_protection: Optional[bool] = None) -> Resourcefunc GetResource(ctx *Context, name string, id IDInput, state *ResourceState, opts ...ResourceOption) (*Resource, error)public static Resource Get(string name, Input<string> id, ResourceState? state, CustomResourceOptions? opts = null)public static Resource get(String name, Output<String> id, ResourceState state, CustomResourceOptions options)resources: _: type: formal:Resource 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.
- Aliases List<string>
- Aliases to apply to the Resource.
- Created
At int - Creation time of the Resource.
- Environment string
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- Hostname string
- Hostname of the Resource.
- Name string
- Friendly name for the Resource.
- Port int
- The port your Resource is listening on.
- Space
Id string - The ID of the Space to create the Resource in.
- Dictionary<string, string>
- Tags to apply to the Resource.
- Technology string
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - Technology
Provider string - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - Termination
Protection bool - If set to true, the Resource cannot be deleted.
- Aliases []string
- Aliases to apply to the Resource.
- Created
At int - Creation time of the Resource.
- Environment string
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- Hostname string
- Hostname of the Resource.
- Name string
- Friendly name for the Resource.
- Port int
- The port your Resource is listening on.
- Space
Id string - The ID of the Space to create the Resource in.
- map[string]string
- Tags to apply to the Resource.
- Technology string
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - Technology
Provider string - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - Termination
Protection bool - If set to true, the Resource cannot be deleted.
- aliases List<String>
- Aliases to apply to the Resource.
- created
At Integer - Creation time of the Resource.
- environment String
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- hostname String
- Hostname of the Resource.
- name String
- Friendly name for the Resource.
- port Integer
- The port your Resource is listening on.
- space
Id String - The ID of the Space to create the Resource in.
- Map<String,String>
- Tags to apply to the Resource.
- technology String
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - technology
Provider String - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination
Protection Boolean - If set to true, the Resource cannot be deleted.
- aliases string[]
- Aliases to apply to the Resource.
- created
At number - Creation time of the Resource.
- environment string
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- hostname string
- Hostname of the Resource.
- name string
- Friendly name for the Resource.
- port number
- The port your Resource is listening on.
- space
Id string - The ID of the Space to create the Resource in.
- {[key: string]: string}
- Tags to apply to the Resource.
- technology string
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - technology
Provider string - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination
Protection boolean - If set to true, the Resource cannot be deleted.
- aliases Sequence[str]
- Aliases to apply to the Resource.
- created_
at int - Creation time of the Resource.
- environment str
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- hostname str
- Hostname of the Resource.
- name str
- Friendly name for the Resource.
- port int
- The port your Resource is listening on.
- space_
id str - The ID of the Space to create the Resource in.
- Mapping[str, str]
- Tags to apply to the Resource.
- technology str
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - technology_
provider str - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination_
protection bool - If set to true, the Resource cannot be deleted.
- aliases List<String>
- Aliases to apply to the Resource.
- created
At Number - Creation time of the Resource.
- environment String
- Environment for the Resource, options: DEV, TEST, QA, UAT, EI, PRE, STG, NON_PROD, PROD, CORP.
- hostname String
- Hostname of the Resource.
- name String
- Friendly name for the Resource.
- port Number
- The port your Resource is listening on.
- space
Id String - The ID of the Space to create the Resource in.
- Map<String>
- Tags to apply to the Resource.
- technology String
- Technology of the Resource: supported values are
snowflake,postgres,rdp,redshift,mysql,mariadb,s3,dynamodb,mongodb,documentdb,http,clickhouse,redis,web,sshandgrpc. - technology
Provider String - For SSH resources, if the backend connection is SSM, supported values are
aws-ec2, andaws-ecs - termination
Protection Boolean - If set to true, the Resource cannot be deleted.
Package Details
- Repository
- formal formalco/pulumi-formal
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
formalTerraform Provider.
