All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.ssm.kotlin.PatchGroup.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.ssm.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [PatchGroup].
 */
@PulumiTagMarker
public class PatchGroupResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: PatchGroupArgs = PatchGroupArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend PatchGroupArgsBuilder.() -> Unit) {
        val builder = PatchGroupArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): PatchGroup {
        val builtJavaResource = com.pulumi.aws.ssm.PatchGroup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return PatchGroup(builtJavaResource)
    }
}

/**
 * Provides an SSM Patch Group resource
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const production = new aws.ssm.PatchBaseline("production", {
 *     name: "patch-baseline",
 *     approvedPatches: ["KB123456"],
 * });
 * const patchgroup = new aws.ssm.PatchGroup("patchgroup", {
 *     baselineId: production.id,
 *     patchGroup: "patch-group-name",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * production = aws.ssm.PatchBaseline("production",
 *     name="patch-baseline",
 *     approved_patches=["KB123456"])
 * patchgroup = aws.ssm.PatchGroup("patchgroup",
 *     baseline_id=production.id,
 *     patch_group="patch-group-name")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var production = new Aws.Ssm.PatchBaseline("production", new()
 *     {
 *         Name = "patch-baseline",
 *         ApprovedPatches = new[]
 *         {
 *             "KB123456",
 *         },
 *     });
 *     var patchgroup = new Aws.Ssm.PatchGroup("patchgroup", new()
 *     {
 *         BaselineId = production.Id,
 *         PatchGroupName = "patch-group-name",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		production, err := ssm.NewPatchBaseline(ctx, "production", &ssm.PatchBaselineArgs{
 * 			Name: pulumi.String("patch-baseline"),
 * 			ApprovedPatches: pulumi.StringArray{
 * 				pulumi.String("KB123456"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = ssm.NewPatchGroup(ctx, "patchgroup", &ssm.PatchGroupArgs{
 * 			BaselineId: production.ID(),
 * 			PatchGroup: pulumi.String("patch-group-name"),
 * 		})
 * 		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.aws.ssm.PatchBaseline;
 * import com.pulumi.aws.ssm.PatchBaselineArgs;
 * import com.pulumi.aws.ssm.PatchGroup;
 * import com.pulumi.aws.ssm.PatchGroupArgs;
 * 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 production = new PatchBaseline("production", PatchBaselineArgs.builder()
 *             .name("patch-baseline")
 *             .approvedPatches("KB123456")
 *             .build());
 *         var patchgroup = new PatchGroup("patchgroup", PatchGroupArgs.builder()
 *             .baselineId(production.id())
 *             .patchGroup("patch-group-name")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   production:
 *     type: aws:ssm:PatchBaseline
 *     properties:
 *       name: patch-baseline
 *       approvedPatches:
 *         - KB123456
 *   patchgroup:
 *     type: aws:ssm:PatchGroup
 *     properties:
 *       baselineId: ${production.id}
 *       patchGroup: patch-group-name
 * ```
 * 
 */
public class PatchGroup internal constructor(
    override val javaResource: com.pulumi.aws.ssm.PatchGroup,
) : KotlinCustomResource(javaResource, PatchGroupMapper) {
    /**
     * The ID of the patch baseline to register the patch group with.
     */
    public val baselineId: Output
        get() = javaResource.baselineId().applyValue({ args0 -> args0 })

    /**
     * The name of the patch group that should be registered with the patch baseline.
     */
    public val patchGroup: Output
        get() = javaResource.patchGroup().applyValue({ args0 -> args0 })
}

public object PatchGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.ssm.PatchGroup::class == javaResource::class

    override fun map(javaResource: Resource): PatchGroup = PatchGroup(
        javaResource as
            com.pulumi.aws.ssm.PatchGroup,
    )
}

/**
 * @see [PatchGroup].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [PatchGroup].
 */
public suspend fun patchGroup(name: String, block: suspend PatchGroupResourceBuilder.() -> Unit): PatchGroup {
    val builder = PatchGroupResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [PatchGroup].
 * @param name The _unique_ name of the resulting resource.
 */
public fun patchGroup(name: String): PatchGroup {
    val builder = PatchGroupResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy