cockroach.MaintenanceWindow
Explore with Pulumi AI
Maintenance window configuration for a cluster.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cockroach from "@pulumiverse/cockroach";
const config = new pulumi.Config();
const clusterId = config.require("clusterId");
const offsetDuration = config.getNumber("offsetDuration") || 172800;
const windowDuration = config.getNumber("windowDuration") || 21600;
const example = new cockroach.MaintenanceWindow("example", {
clusterId: clusterId,
offsetDuration: offsetDuration,
windowDuration: windowDuration,
});
import pulumi
import pulumiverse_cockroach as cockroach
config = pulumi.Config()
cluster_id = config.require("clusterId")
offset_duration = config.get_float("offsetDuration")
if offset_duration is None:
offset_duration = 172800
window_duration = config.get_float("windowDuration")
if window_duration is None:
window_duration = 21600
example = cockroach.MaintenanceWindow("example",
cluster_id=cluster_id,
offset_duration=offset_duration,
window_duration=window_duration)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
"github.com/pulumiverse/pulumi-cockroach/sdk/go/cockroach"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
clusterId := cfg.Require("clusterId")
offsetDuration := float64(172800)
if param := cfg.GetFloat64("offsetDuration"); param != 0 {
offsetDuration = param
}
windowDuration := float64(21600)
if param := cfg.GetFloat64("windowDuration"); param != 0 {
windowDuration = param
}
_, err := cockroach.NewMaintenanceWindow(ctx, "example", &cockroach.MaintenanceWindowArgs{
ClusterId: pulumi.String(clusterId),
OffsetDuration: pulumi.Float64(offsetDuration),
WindowDuration: pulumi.Float64(windowDuration),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cockroach = Pulumiverse.Cockroach;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var clusterId = config.Require("clusterId");
var offsetDuration = config.GetDouble("offsetDuration") ?? 172800;
var windowDuration = config.GetDouble("windowDuration") ?? 21600;
var example = new Cockroach.MaintenanceWindow("example", new()
{
ClusterId = clusterId,
OffsetDuration = offsetDuration,
WindowDuration = windowDuration,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cockroach.MaintenanceWindow;
import com.pulumi.cockroach.MaintenanceWindowArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var clusterId = config.get("clusterId");
final var offsetDuration = config.get("offsetDuration").orElse(172800);
final var windowDuration = config.get("windowDuration").orElse(21600);
var example = new MaintenanceWindow("example", MaintenanceWindowArgs.builder()
.clusterId(clusterId)
.offsetDuration(offsetDuration)
.windowDuration(windowDuration)
.build());
}
}
configuration:
clusterId:
type: string
offsetDuration:
type: number
default: 172800
windowDuration:
type: number
default: 21600
resources:
example:
type: cockroach:MaintenanceWindow
properties:
clusterId: ${clusterId}
offsetDuration: ${offsetDuration}
windowDuration: ${windowDuration}
Create MaintenanceWindow Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MaintenanceWindow(name: string, args: MaintenanceWindowArgs, opts?: CustomResourceOptions);
@overload
def MaintenanceWindow(resource_name: str,
args: MaintenanceWindowArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MaintenanceWindow(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
offset_duration: Optional[int] = None,
window_duration: Optional[int] = None)
func NewMaintenanceWindow(ctx *Context, name string, args MaintenanceWindowArgs, opts ...ResourceOption) (*MaintenanceWindow, error)
public MaintenanceWindow(string name, MaintenanceWindowArgs args, CustomResourceOptions? opts = null)
public MaintenanceWindow(String name, MaintenanceWindowArgs args)
public MaintenanceWindow(String name, MaintenanceWindowArgs args, CustomResourceOptions options)
type: cockroach:MaintenanceWindow
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 MaintenanceWindowArgs
- 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 MaintenanceWindowArgs
- 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 MaintenanceWindowArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MaintenanceWindowArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MaintenanceWindowArgs
- 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 maintenanceWindowResource = new Cockroach.MaintenanceWindow("maintenanceWindowResource", new()
{
ClusterId = "string",
OffsetDuration = 0,
WindowDuration = 0,
});
example, err := cockroach.NewMaintenanceWindow(ctx, "maintenanceWindowResource", &cockroach.MaintenanceWindowArgs{
ClusterId: pulumi.String("string"),
OffsetDuration: pulumi.Int(0),
WindowDuration: pulumi.Int(0),
})
var maintenanceWindowResource = new MaintenanceWindow("maintenanceWindowResource", MaintenanceWindowArgs.builder()
.clusterId("string")
.offsetDuration(0)
.windowDuration(0)
.build());
maintenance_window_resource = cockroach.MaintenanceWindow("maintenanceWindowResource",
cluster_id="string",
offset_duration=0,
window_duration=0)
const maintenanceWindowResource = new cockroach.MaintenanceWindow("maintenanceWindowResource", {
clusterId: "string",
offsetDuration: 0,
windowDuration: 0,
});
type: cockroach:MaintenanceWindow
properties:
clusterId: string
offsetDuration: 0
windowDuration: 0
MaintenanceWindow 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 MaintenanceWindow resource accepts the following input properties:
- Cluster
Id string - Cluster ID.
- Offset
Duration int - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- Window
Duration int - Duration in seconds that the maintenance window will remain active for after it starts.
- Cluster
Id string - Cluster ID.
- Offset
Duration int - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- Window
Duration int - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster
Id String - Cluster ID.
- offset
Duration Integer - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window
Duration Integer - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster
Id string - Cluster ID.
- offset
Duration number - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window
Duration number - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster_
id str - Cluster ID.
- offset_
duration int - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window_
duration int - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster
Id String - Cluster ID.
- offset
Duration Number - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window
Duration Number - Duration in seconds that the maintenance window will remain active for after it starts.
Outputs
All input properties are implicitly available as output properties. Additionally, the MaintenanceWindow resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing MaintenanceWindow Resource
Get an existing MaintenanceWindow 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?: MaintenanceWindowState, opts?: CustomResourceOptions): MaintenanceWindow
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
offset_duration: Optional[int] = None,
window_duration: Optional[int] = None) -> MaintenanceWindow
func GetMaintenanceWindow(ctx *Context, name string, id IDInput, state *MaintenanceWindowState, opts ...ResourceOption) (*MaintenanceWindow, error)
public static MaintenanceWindow Get(string name, Input<string> id, MaintenanceWindowState? state, CustomResourceOptions? opts = null)
public static MaintenanceWindow get(String name, Output<String> id, MaintenanceWindowState 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.
- Cluster
Id string - Cluster ID.
- Offset
Duration int - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- Window
Duration int - Duration in seconds that the maintenance window will remain active for after it starts.
- Cluster
Id string - Cluster ID.
- Offset
Duration int - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- Window
Duration int - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster
Id String - Cluster ID.
- offset
Duration Integer - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window
Duration Integer - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster
Id string - Cluster ID.
- offset
Duration number - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window
Duration number - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster_
id str - Cluster ID.
- offset_
duration int - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window_
duration int - Duration in seconds that the maintenance window will remain active for after it starts.
- cluster
Id String - Cluster ID.
- offset
Duration Number - Duration in seconds from the beginning of each Monday (UTC) after which the maintenance window starts.
- window
Duration Number - Duration in seconds that the maintenance window will remain active for after it starts.
Package Details
- Repository
- cockroach pulumiverse/pulumi-cockroach
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cockroach
Terraform Provider.