Skip to content

Commit

Permalink
make tailscale tags required
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxstorm committed Nov 4, 2023
1 parent 43d8922 commit b02b086
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 57 deletions.
3 changes: 3 additions & 0 deletions schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ resources:
- subnetId
- route
- location
- tailscaleTags
properties:
scaleSetName:
type: string
Expand Down Expand Up @@ -75,6 +76,7 @@ resources:
- subnetIds
- route
- region
- tailscaleTags
properties:
asgName:
type: string
Expand Down Expand Up @@ -108,6 +110,7 @@ resources:
requiredInputs:
- createNamespace
- routes
- tailscaleTags
properties:
deploymentName:
type: string
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TailscaleBastion/Aws/Bastion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public InputList<string> SubnetIds
set => _subnetIds = value;
}

[Input("tailscaleTags")]
[Input("tailscaleTags", required: true)]
private InputList<string>? _tailscaleTags;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TailscaleBastion/Azure/Bastion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public sealed class BastionArgs : global::Pulumi.ResourceArgs
[Input("subnetId", required: true)]
public Input<string> SubnetId { get; set; } = null!;

[Input("tailscaleTags")]
[Input("tailscaleTags", required: true)]
private InputList<string>? _tailscaleTags;

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/TailscaleBastion/Kubernetes/Bastion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public InputList<string> Routes
set => _routes = value;
}

[Input("tailscaleTags")]
[Input("tailscaleTags", required: true)]
private InputList<string>? _tailscaleTags;

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions sdk/go/bastion/aws/bastion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions sdk/go/bastion/azure/bastion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions sdk/go/bastion/kubernetes/bastion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion sdk/nodejs/aws/bastion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export class Bastion extends pulumi.ComponentResource {
if ((!args || args.subnetIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
if ((!args || args.tailscaleTags === undefined) && !opts.urn) {
throw new Error("Missing required property 'tailscaleTags'");
}
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
Expand Down Expand Up @@ -91,7 +94,7 @@ export interface BastionArgs {
/**
* The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
*/
tailscaleTags?: pulumi.Input<pulumi.Input<string>[]>;
tailscaleTags: pulumi.Input<pulumi.Input<string>[]>;
/**
* The VPC the Bastion should be created in.
*/
Expand Down
5 changes: 4 additions & 1 deletion sdk/nodejs/azure/bastion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export class Bastion extends pulumi.ComponentResource {
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
if ((!args || args.tailscaleTags === undefined) && !opts.urn) {
throw new Error("Missing required property 'tailscaleTags'");
}
resourceInputs["instanceSku"] = args ? args.instanceSku : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["resourceGroupName"] = args ? args.resourceGroupName : undefined;
Expand Down Expand Up @@ -95,5 +98,5 @@ export interface BastionArgs {
/**
* The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
*/
tailscaleTags?: pulumi.Input<pulumi.Input<string>[]>;
tailscaleTags: pulumi.Input<pulumi.Input<string>[]>;
}
5 changes: 4 additions & 1 deletion sdk/nodejs/kubernetes/bastion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export class Bastion extends pulumi.ComponentResource {
if ((!args || args.routes === undefined) && !opts.urn) {
throw new Error("Missing required property 'routes'");
}
if ((!args || args.tailscaleTags === undefined) && !opts.urn) {
throw new Error("Missing required property 'tailscaleTags'");
}
resourceInputs["createNamespace"] = args ? args.createNamespace : undefined;
resourceInputs["namespace"] = args ? args.namespace : undefined;
resourceInputs["routes"] = args ? args.routes : undefined;
Expand Down Expand Up @@ -75,5 +78,5 @@ export interface BastionArgs {
/**
* The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
*/
tailscaleTags?: pulumi.Input<pulumi.Input<string>[]>;
tailscaleTags: pulumi.Input<pulumi.Input<string>[]>;
}
35 changes: 18 additions & 17 deletions sdk/python/lbrlabs_pulumi_tailscalebastion/aws/bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,25 @@ def __init__(__self__, *,
region: pulumi.Input[str],
route: pulumi.Input[str],
subnet_ids: pulumi.Input[Sequence[pulumi.Input[str]]],
tailscale_tags: pulumi.Input[Sequence[pulumi.Input[str]]],
vpc_id: pulumi.Input[str],
instance_type: Optional[pulumi.Input[str]] = None,
tailscale_tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
instance_type: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a Bastion resource.
:param pulumi.Input[str] region: The AWS region you're using.
:param pulumi.Input[str] route: The route you'd like to advertise via tailscale.
:param pulumi.Input[Sequence[pulumi.Input[str]]] subnet_ids: The subnet Ids to launch instances in.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tailscale_tags: The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
:param pulumi.Input[str] vpc_id: The VPC the Bastion should be created in.
:param pulumi.Input[str] instance_type: The EC2 instance type to use for the bastion.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tailscale_tags: The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
pulumi.set(__self__, "region", region)
pulumi.set(__self__, "route", route)
pulumi.set(__self__, "subnet_ids", subnet_ids)
pulumi.set(__self__, "tailscale_tags", tailscale_tags)
pulumi.set(__self__, "vpc_id", vpc_id)
if instance_type is not None:
pulumi.set(__self__, "instance_type", instance_type)
if tailscale_tags is not None:
pulumi.set(__self__, "tailscale_tags", tailscale_tags)

@property
@pulumi.getter
Expand Down Expand Up @@ -74,6 +73,18 @@ def subnet_ids(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
def subnet_ids(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "subnet_ids", value)

@property
@pulumi.getter(name="tailscaleTags")
def tailscale_tags(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
"""
The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
return pulumi.get(self, "tailscale_tags")

@tailscale_tags.setter
def tailscale_tags(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "tailscale_tags", value)

@property
@pulumi.getter(name="vpcId")
def vpc_id(self) -> pulumi.Input[str]:
Expand All @@ -98,18 +109,6 @@ def instance_type(self) -> Optional[pulumi.Input[str]]:
def instance_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "instance_type", value)

@property
@pulumi.getter(name="tailscaleTags")
def tailscale_tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
return pulumi.get(self, "tailscale_tags")

@tailscale_tags.setter
def tailscale_tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "tailscale_tags", value)


class Bastion(pulumi.ComponentResource):
@overload
Expand Down Expand Up @@ -184,6 +183,8 @@ def _internal_init(__self__,
if subnet_ids is None and not opts.urn:
raise TypeError("Missing required property 'subnet_ids'")
__props__.__dict__["subnet_ids"] = subnet_ids
if tailscale_tags is None and not opts.urn:
raise TypeError("Missing required property 'tailscale_tags'")
__props__.__dict__["tailscale_tags"] = tailscale_tags
if vpc_id is None and not opts.urn:
raise TypeError("Missing required property 'vpc_id'")
Expand Down
35 changes: 18 additions & 17 deletions sdk/python/lbrlabs_pulumi_tailscalebastion/azure/bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@ def __init__(__self__, *,
resource_group_name: pulumi.Input[str],
route: pulumi.Input[str],
subnet_id: pulumi.Input[str],
instance_sku: Optional[pulumi.Input[str]] = None,
tailscale_tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
tailscale_tags: pulumi.Input[Sequence[pulumi.Input[str]]],
instance_sku: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a Bastion resource.
:param pulumi.Input[str] location: The Azure region you're using.
:param pulumi.Input[str] resource_group_name: The Azure resource group to create the bastion in.
:param pulumi.Input[str] route: The route you'd like to advertise via tailscale.
:param pulumi.Input[str] subnet_id: The subnet Ids to launch instances in.
:param pulumi.Input[str] instance_sku: The Azure instance SKU to use for the bastion.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tailscale_tags: The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
:param pulumi.Input[str] instance_sku: The Azure instance SKU to use for the bastion.
"""
pulumi.set(__self__, "location", location)
pulumi.set(__self__, "resource_group_name", resource_group_name)
pulumi.set(__self__, "route", route)
pulumi.set(__self__, "subnet_id", subnet_id)
pulumi.set(__self__, "tailscale_tags", tailscale_tags)
if instance_sku is not None:
pulumi.set(__self__, "instance_sku", instance_sku)
if tailscale_tags is not None:
pulumi.set(__self__, "tailscale_tags", tailscale_tags)

@property
@pulumi.getter
Expand Down Expand Up @@ -86,6 +85,18 @@ def subnet_id(self) -> pulumi.Input[str]:
def subnet_id(self, value: pulumi.Input[str]):
pulumi.set(self, "subnet_id", value)

@property
@pulumi.getter(name="tailscaleTags")
def tailscale_tags(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
"""
The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
return pulumi.get(self, "tailscale_tags")

@tailscale_tags.setter
def tailscale_tags(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "tailscale_tags", value)

@property
@pulumi.getter(name="instanceSku")
def instance_sku(self) -> Optional[pulumi.Input[str]]:
Expand All @@ -98,18 +109,6 @@ def instance_sku(self) -> Optional[pulumi.Input[str]]:
def instance_sku(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "instance_sku", value)

@property
@pulumi.getter(name="tailscaleTags")
def tailscale_tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
return pulumi.get(self, "tailscale_tags")

@tailscale_tags.setter
def tailscale_tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "tailscale_tags", value)


class Bastion(pulumi.ComponentResource):
@overload
Expand Down Expand Up @@ -187,6 +186,8 @@ def _internal_init(__self__,
if subnet_id is None and not opts.urn:
raise TypeError("Missing required property 'subnet_id'")
__props__.__dict__["subnet_id"] = subnet_id
if tailscale_tags is None and not opts.urn:
raise TypeError("Missing required property 'tailscale_tags'")
__props__.__dict__["tailscale_tags"] = tailscale_tags
__props__.__dict__["private_key"] = None
__props__.__dict__["scale_set_name"] = None
Expand Down
35 changes: 18 additions & 17 deletions sdk/python/lbrlabs_pulumi_tailscalebastion/kubernetes/bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@ class BastionArgs:
def __init__(__self__, *,
create_namespace: bool,
routes: pulumi.Input[Sequence[pulumi.Input[str]]],
namespace: Optional[pulumi.Input['pulumi_kubernetes.core.v1.Namespace']] = None,
tailscale_tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
tailscale_tags: pulumi.Input[Sequence[pulumi.Input[str]]],
namespace: Optional[pulumi.Input['pulumi_kubernetes.core.v1.Namespace']] = None):
"""
The set of arguments for constructing a Bastion resource.
:param bool create_namespace: Whether we should create a new namespace.
:param pulumi.Input[Sequence[pulumi.Input[str]]] routes: The routes to advertise to tailscale. This is likely the Pod and Service CIDR.
:param pulumi.Input['pulumi_kubernetes.core.v1.Namespace'] namespace: The bucket resource.
:param pulumi.Input[Sequence[pulumi.Input[str]]] tailscale_tags: The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
:param pulumi.Input['pulumi_kubernetes.core.v1.Namespace'] namespace: The bucket resource.
"""
pulumi.set(__self__, "create_namespace", create_namespace)
pulumi.set(__self__, "routes", routes)
pulumi.set(__self__, "tailscale_tags", tailscale_tags)
if namespace is not None:
pulumi.set(__self__, "namespace", namespace)
if tailscale_tags is not None:
pulumi.set(__self__, "tailscale_tags", tailscale_tags)

@property
@pulumi.getter(name="createNamespace")
Expand All @@ -57,6 +56,18 @@ def routes(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
def routes(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "routes", value)

@property
@pulumi.getter(name="tailscaleTags")
def tailscale_tags(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
"""
The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
return pulumi.get(self, "tailscale_tags")

@tailscale_tags.setter
def tailscale_tags(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
pulumi.set(self, "tailscale_tags", value)

@property
@pulumi.getter
def namespace(self) -> Optional[pulumi.Input['pulumi_kubernetes.core.v1.Namespace']]:
Expand All @@ -69,18 +80,6 @@ def namespace(self) -> Optional[pulumi.Input['pulumi_kubernetes.core.v1.Namespac
def namespace(self, value: Optional[pulumi.Input['pulumi_kubernetes.core.v1.Namespace']]):
pulumi.set(self, "namespace", value)

@property
@pulumi.getter(name="tailscaleTags")
def tailscale_tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
"""
return pulumi.get(self, "tailscale_tags")

@tailscale_tags.setter
def tailscale_tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "tailscale_tags", value)


class Bastion(pulumi.ComponentResource):
@overload
Expand Down Expand Up @@ -146,6 +145,8 @@ def _internal_init(__self__,
if routes is None and not opts.urn:
raise TypeError("Missing required property 'routes'")
__props__.__dict__["routes"] = routes
if tailscale_tags is None and not opts.urn:
raise TypeError("Missing required property 'tailscale_tags'")
__props__.__dict__["tailscale_tags"] = tailscale_tags
__props__.__dict__["deployment_name"] = None
super(Bastion, __self__).__init__(
Expand Down

0 comments on commit b02b086

Please sign in to comment.