genesiscloud.SecurityGroup
Explore with Pulumi AI
Security group resource
Example Usage
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.genesiscloud.SecurityGroup;
import com.pulumi.genesiscloud.SecurityGroupArgs;
import com.pulumi.genesiscloud.inputs.SecurityGroupRuleArgs;
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 allow_https = new SecurityGroup("allow-https", SecurityGroupArgs.builder()
.region("ARC-IS-HAF-1")
.rules(SecurityGroupRuleArgs.builder()
.direction("ingress")
.port_range_max(443)
.port_range_min(443)
.protocol("tcp")
.build())
.build());
}
}
Coming soon!
Coming soon!
resources:
allow-https:
type: genesiscloud:SecurityGroup
properties:
region: ARC-IS-HAF-1
rules:
- direction: ingress
port_range_max: 443
port_range_min: 443
protocol: tcp
Create SecurityGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecurityGroup(name: string, args: SecurityGroupArgs, opts?: CustomResourceOptions);
@overload
def SecurityGroup(resource_name: str,
args: SecurityGroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecurityGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
region: Optional[str] = None,
rules: Optional[Sequence[SecurityGroupRuleArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[SecurityGroupTimeoutsArgs] = None)
func NewSecurityGroup(ctx *Context, name string, args SecurityGroupArgs, opts ...ResourceOption) (*SecurityGroup, error)
public SecurityGroup(string name, SecurityGroupArgs args, CustomResourceOptions? opts = null)
public SecurityGroup(String name, SecurityGroupArgs args)
public SecurityGroup(String name, SecurityGroupArgs args, CustomResourceOptions options)
type: genesiscloud:SecurityGroup
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 SecurityGroupArgs
- 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 SecurityGroupArgs
- 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 SecurityGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecurityGroupArgs
- 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 securityGroupResource = new Genesiscloud.SecurityGroup("securityGroupResource", new()
{
Region = "string",
Rules = new[]
{
new Genesiscloud.Inputs.SecurityGroupRuleArgs
{
Direction = "string",
Protocol = "string",
PortRangeMax = 0,
PortRangeMin = 0,
},
},
Description = "string",
Name = "string",
Timeouts = new Genesiscloud.Inputs.SecurityGroupTimeoutsArgs
{
Create = "string",
Delete = "string",
Read = "string",
Update = "string",
},
});
example, err := genesiscloud.NewSecurityGroup(ctx, "securityGroupResource", &genesiscloud.SecurityGroupArgs{
Region: pulumi.String("string"),
Rules: genesiscloud.SecurityGroupRuleArray{
&genesiscloud.SecurityGroupRuleArgs{
Direction: pulumi.String("string"),
Protocol: pulumi.String("string"),
PortRangeMax: pulumi.Int(0),
PortRangeMin: pulumi.Int(0),
},
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Timeouts: &genesiscloud.SecurityGroupTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Read: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var securityGroupResource = new SecurityGroup("securityGroupResource", SecurityGroupArgs.builder()
.region("string")
.rules(SecurityGroupRuleArgs.builder()
.direction("string")
.protocol("string")
.portRangeMax(0)
.portRangeMin(0)
.build())
.description("string")
.name("string")
.timeouts(SecurityGroupTimeoutsArgs.builder()
.create("string")
.delete("string")
.read("string")
.update("string")
.build())
.build());
security_group_resource = genesiscloud.SecurityGroup("securityGroupResource",
region="string",
rules=[genesiscloud.SecurityGroupRuleArgs(
direction="string",
protocol="string",
port_range_max=0,
port_range_min=0,
)],
description="string",
name="string",
timeouts=genesiscloud.SecurityGroupTimeoutsArgs(
create="string",
delete="string",
read="string",
update="string",
))
const securityGroupResource = new genesiscloud.SecurityGroup("securityGroupResource", {
region: "string",
rules: [{
direction: "string",
protocol: "string",
portRangeMax: 0,
portRangeMin: 0,
}],
description: "string",
name: "string",
timeouts: {
create: "string",
"delete": "string",
read: "string",
update: "string",
},
});
type: genesiscloud:SecurityGroup
properties:
description: string
name: string
region: string
rules:
- direction: string
portRangeMax: 0
portRangeMin: 0
protocol: string
timeouts:
create: string
delete: string
read: string
update: string
SecurityGroup Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The SecurityGroup resource accepts the following input properties:
- Region string
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- Rules
List<Genesis
Cloud. Pulumi Package. Genesiscloud. Inputs. Security Group Rule> - Description string
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- Name string
- The human-readable name for the security group.
- Timeouts
Genesis
Cloud. Pulumi Package. Genesiscloud. Inputs. Security Group Timeouts
- Region string
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- Rules
[]Security
Group Rule Args - Description string
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- Name string
- The human-readable name for the security group.
- Timeouts
Security
Group Timeouts Args
- region String
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules
List<Security
Group Rule> - description String
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name String
- The human-readable name for the security group.
- timeouts
Security
Group Timeouts
- region string
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules
Security
Group Rule[] - description string
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name string
- The human-readable name for the security group.
- timeouts
Security
Group Timeouts
- region str
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules
Sequence[Security
Group Rule Args] - description str
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name str
- The human-readable name for the security group.
- timeouts
Security
Group Timeouts Args
- region String
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules List<Property Map>
- description String
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name String
- The human-readable name for the security group.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the SecurityGroup resource produces the following output properties:
- created_
at str - The timestamp when this security group was created in RFC 3339.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The security group status.
Look up Existing SecurityGroup Resource
Get an existing SecurityGroup 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?: SecurityGroupState, opts?: CustomResourceOptions): SecurityGroup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
rules: Optional[Sequence[SecurityGroupRuleArgs]] = None,
status: Optional[str] = None,
timeouts: Optional[SecurityGroupTimeoutsArgs] = None) -> SecurityGroup
func GetSecurityGroup(ctx *Context, name string, id IDInput, state *SecurityGroupState, opts ...ResourceOption) (*SecurityGroup, error)
public static SecurityGroup Get(string name, Input<string> id, SecurityGroupState? state, CustomResourceOptions? opts = null)
public static SecurityGroup get(String name, Output<String> id, SecurityGroupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Created
At string - The timestamp when this security group was created in RFC 3339.
- Description string
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- Name string
- The human-readable name for the security group.
- Region string
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- Rules
List<Genesis
Cloud. Pulumi Package. Genesiscloud. Inputs. Security Group Rule> - Status string
- The security group status.
- Timeouts
Genesis
Cloud. Pulumi Package. Genesiscloud. Inputs. Security Group Timeouts
- Created
At string - The timestamp when this security group was created in RFC 3339.
- Description string
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- Name string
- The human-readable name for the security group.
- Region string
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- Rules
[]Security
Group Rule Args - Status string
- The security group status.
- Timeouts
Security
Group Timeouts Args
- created
At String - The timestamp when this security group was created in RFC 3339.
- description String
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name String
- The human-readable name for the security group.
- region String
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules
List<Security
Group Rule> - status String
- The security group status.
- timeouts
Security
Group Timeouts
- created
At string - The timestamp when this security group was created in RFC 3339.
- description string
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name string
- The human-readable name for the security group.
- region string
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules
Security
Group Rule[] - status string
- The security group status.
- timeouts
Security
Group Timeouts
- created_
at str - The timestamp when this security group was created in RFC 3339.
- description str
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name str
- The human-readable name for the security group.
- region str
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules
Sequence[Security
Group Rule Args] - status str
- The security group status.
- timeouts
Security
Group Timeouts Args
- created
At String - The timestamp when this security group was created in RFC 3339.
- description String
- The human-readable description for the security group. - Sets the default value "" if the attribute is not set.
- name String
- The human-readable name for the security group.
- region String
- The region identifier. - If the value of this attribute changes, Terraform will destroy and recreate the resource. - The value must be one of: ["ARC-IS-HAF-1" "EUC-DE-MUC-1" "NORD-NO-KRS-1"].
- rules List<Property Map>
- status String
- The security group status.
- timeouts Property Map
Supporting Types
SecurityGroupRule, SecurityGroupRuleArgs
- Direction string
- The direction of the rule.
- The value must be one of: ["egress" "ingress"].
- Protocol string
- The protocol of the rule.
- The value must be one of: ["all" "icmp" "tcp" "udp"].
- Port
Range intMax - The maximum port number of the rule.
- The value must be between 1 and 65535.
- Port
Range intMin - The minimum port number of the rule.
- The value must be between 1 and 65535.
- Direction string
- The direction of the rule.
- The value must be one of: ["egress" "ingress"].
- Protocol string
- The protocol of the rule.
- The value must be one of: ["all" "icmp" "tcp" "udp"].
- Port
Range intMax - The maximum port number of the rule.
- The value must be between 1 and 65535.
- Port
Range intMin - The minimum port number of the rule.
- The value must be between 1 and 65535.
- direction String
- The direction of the rule.
- The value must be one of: ["egress" "ingress"].
- protocol String
- The protocol of the rule.
- The value must be one of: ["all" "icmp" "tcp" "udp"].
- port
Range IntegerMax - The maximum port number of the rule.
- The value must be between 1 and 65535.
- port
Range IntegerMin - The minimum port number of the rule.
- The value must be between 1 and 65535.
- direction string
- The direction of the rule.
- The value must be one of: ["egress" "ingress"].
- protocol string
- The protocol of the rule.
- The value must be one of: ["all" "icmp" "tcp" "udp"].
- port
Range numberMax - The maximum port number of the rule.
- The value must be between 1 and 65535.
- port
Range numberMin - The minimum port number of the rule.
- The value must be between 1 and 65535.
- direction str
- The direction of the rule.
- The value must be one of: ["egress" "ingress"].
- protocol str
- The protocol of the rule.
- The value must be one of: ["all" "icmp" "tcp" "udp"].
- port_
range_ intmax - The maximum port number of the rule.
- The value must be between 1 and 65535.
- port_
range_ intmin - The minimum port number of the rule.
- The value must be between 1 and 65535.
- direction String
- The direction of the rule.
- The value must be one of: ["egress" "ingress"].
- protocol String
- The protocol of the rule.
- The value must be one of: ["all" "icmp" "tcp" "udp"].
- port
Range NumberMax - The maximum port number of the rule.
- The value must be between 1 and 65535.
- port
Range NumberMin - The minimum port number of the rule.
- The value must be between 1 and 65535.
SecurityGroupTimeouts, SecurityGroupTimeoutsArgs
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- Read string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- Update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- Read string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- Update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- read String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- update String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- read string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- read str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- update str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- read String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- update String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Import
$ pulumi import genesiscloud:index/securityGroup:SecurityGroup example 18efeec8-94f0-4776-8ff2-5e9b49c74608
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- genesiscloud genesiscloud/pulumi-genesiscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
genesiscloud
Terraform Provider.