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

com.pulumi.gcp.compute.kotlin.SecurityScanConfigArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.SecurityScanConfigArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.SecurityScanConfigAuthenticationArgs
import com.pulumi.gcp.compute.kotlin.inputs.SecurityScanConfigAuthenticationArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.SecurityScanConfigScheduleArgs
import com.pulumi.gcp.compute.kotlin.inputs.SecurityScanConfigScheduleArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A ScanConfig resource contains the configurations to launch a scan.
 * To get more information about ScanConfig, see:
 * * [API documentation](https://cloud.google.com/security-scanner/docs/reference/rest/v1beta/projects.scanConfigs)
 * * How-to Guides
 *     * [Using Cloud Security Scanner](https://cloud.google.com/security-scanner/docs/scanning)
 * ## Example Usage
 * ### Scan Config Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const scannerStaticIp = new gcp.compute.Address("scanner_static_ip", {name: "scan-basic-static-ip"});
 * const scan_config = new gcp.compute.SecurityScanConfig("scan-config", {
 *     displayName: "scan-config",
 *     startingUrls: [pulumi.interpolate`http://${scannerStaticIp.address}`],
 *     targetPlatforms: ["COMPUTE"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * scanner_static_ip = gcp.compute.Address("scanner_static_ip", name="scan-basic-static-ip")
 * scan_config = gcp.compute.SecurityScanConfig("scan-config",
 *     display_name="scan-config",
 *     starting_urls=[scanner_static_ip.address.apply(lambda address: f"http://{address}")],
 *     target_platforms=["COMPUTE"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var scannerStaticIp = new Gcp.Compute.Address("scanner_static_ip", new()
 *     {
 *         Name = "scan-basic-static-ip",
 *     });
 *     var scan_config = new Gcp.Compute.SecurityScanConfig("scan-config", new()
 *     {
 *         DisplayName = "scan-config",
 *         StartingUrls = new[]
 *         {
 *             scannerStaticIp.IPAddress.Apply(address => $"http://{address}"),
 *         },
 *         TargetPlatforms = new[]
 *         {
 *             "COMPUTE",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		scannerStaticIp, err := compute.NewAddress(ctx, "scanner_static_ip", &compute.AddressArgs{
 * 			Name: pulumi.String("scan-basic-static-ip"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewSecurityScanConfig(ctx, "scan-config", &compute.SecurityScanConfigArgs{
 * 			DisplayName: pulumi.String("scan-config"),
 * 			StartingUrls: pulumi.StringArray{
 * 				scannerStaticIp.Address.ApplyT(func(address string) (string, error) {
 * 					return fmt.Sprintf("http://%v", address), nil
 * 				}).(pulumi.StringOutput),
 * 			},
 * 			TargetPlatforms: pulumi.StringArray{
 * 				pulumi.String("COMPUTE"),
 * 			},
 * 		})
 * 		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.gcp.compute.Address;
 * import com.pulumi.gcp.compute.AddressArgs;
 * import com.pulumi.gcp.compute.SecurityScanConfig;
 * import com.pulumi.gcp.compute.SecurityScanConfigArgs;
 * 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 scannerStaticIp = new Address("scannerStaticIp", AddressArgs.builder()
 *             .name("scan-basic-static-ip")
 *             .build());
 *         var scan_config = new SecurityScanConfig("scan-config", SecurityScanConfigArgs.builder()
 *             .displayName("scan-config")
 *             .startingUrls(scannerStaticIp.address().applyValue(address -> String.format("http://%s", address)))
 *             .targetPlatforms("COMPUTE")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   scannerStaticIp:
 *     type: gcp:compute:Address
 *     name: scanner_static_ip
 *     properties:
 *       name: scan-basic-static-ip
 *   scan-config:
 *     type: gcp:compute:SecurityScanConfig
 *     properties:
 *       displayName: scan-config
 *       startingUrls:
 *         - http://${scannerStaticIp.address}
 *       targetPlatforms:
 *         - COMPUTE
 * ```
 * 
 * ## Import
 * ScanConfig can be imported using any of these accepted formats:
 * * `projects/{{project}}/scanConfigs/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, ScanConfig can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/securityScanConfig:SecurityScanConfig default projects/{{project}}/scanConfigs/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/securityScanConfig:SecurityScanConfig default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/securityScanConfig:SecurityScanConfig default {{name}}
 * ```
 * @property authentication The authentication configuration.
 * If specified, service will use the authentication configuration during scanning.
 * Structure is documented below.
 * @property blacklistPatterns The blacklist URL patterns as described in
 * https://cloud.google.com/security-scanner/docs/excluded-urls
 * @property displayName The user provider display name of the ScanConfig.
 * @property exportToSecurityCommandCenter Controls export of scan configurations and results to Cloud Security Command Center.
 * Default value is `ENABLED`.
 * Possible values are: `ENABLED`, `DISABLED`.
 * @property maxQps The maximum QPS during scanning. A valid value ranges from 5 to 20 inclusively.
 * Defaults to 15.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property schedule The schedule of the ScanConfig
 * Structure is documented below.
 * @property startingUrls The starting URLs from which the scanner finds site pages.
 * - - -
 * @property targetPlatforms Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
 * Each value may be one of: `APP_ENGINE`, `COMPUTE`.
 * @property userAgent Type of the user agents used for scanning
 * Default value is `CHROME_LINUX`.
 * Possible values are: `USER_AGENT_UNSPECIFIED`, `CHROME_LINUX`, `CHROME_ANDROID`, `SAFARI_IPHONE`.
 */
public data class SecurityScanConfigArgs(
    public val authentication: Output? = null,
    public val blacklistPatterns: Output>? = null,
    public val displayName: Output? = null,
    public val exportToSecurityCommandCenter: Output? = null,
    public val maxQps: Output? = null,
    public val project: Output? = null,
    public val schedule: Output? = null,
    public val startingUrls: Output>? = null,
    public val targetPlatforms: Output>? = null,
    public val userAgent: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.SecurityScanConfigArgs =
        com.pulumi.gcp.compute.SecurityScanConfigArgs.builder()
            .authentication(authentication?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .blacklistPatterns(blacklistPatterns?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .exportToSecurityCommandCenter(exportToSecurityCommandCenter?.applyValue({ args0 -> args0 }))
            .maxQps(maxQps?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .schedule(schedule?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .startingUrls(startingUrls?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .targetPlatforms(targetPlatforms?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .userAgent(userAgent?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SecurityScanConfigArgs].
 */
@PulumiTagMarker
public class SecurityScanConfigArgsBuilder internal constructor() {
    private var authentication: Output? = null

    private var blacklistPatterns: Output>? = null

    private var displayName: Output? = null

    private var exportToSecurityCommandCenter: Output? = null

    private var maxQps: Output? = null

    private var project: Output? = null

    private var schedule: Output? = null

    private var startingUrls: Output>? = null

    private var targetPlatforms: Output>? = null

    private var userAgent: Output? = null

    /**
     * @param value The authentication configuration.
     * If specified, service will use the authentication configuration during scanning.
     * Structure is documented below.
     */
    @JvmName("iifixdcjnqfchaqj")
    public suspend fun authentication(`value`: Output) {
        this.authentication = value
    }

    /**
     * @param value The blacklist URL patterns as described in
     * https://cloud.google.com/security-scanner/docs/excluded-urls
     */
    @JvmName("deyciwfcejwpjoxo")
    public suspend fun blacklistPatterns(`value`: Output>) {
        this.blacklistPatterns = value
    }

    @JvmName("unpwfbgejfavaabp")
    public suspend fun blacklistPatterns(vararg values: Output) {
        this.blacklistPatterns = Output.all(values.asList())
    }

    /**
     * @param values The blacklist URL patterns as described in
     * https://cloud.google.com/security-scanner/docs/excluded-urls
     */
    @JvmName("ihwvvkkusgqgbfgs")
    public suspend fun blacklistPatterns(values: List>) {
        this.blacklistPatterns = Output.all(values)
    }

    /**
     * @param value The user provider display name of the ScanConfig.
     */
    @JvmName("lnbkdmgvjxaopjjg")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Controls export of scan configurations and results to Cloud Security Command Center.
     * Default value is `ENABLED`.
     * Possible values are: `ENABLED`, `DISABLED`.
     */
    @JvmName("ciqkruyhettjsgyu")
    public suspend fun exportToSecurityCommandCenter(`value`: Output) {
        this.exportToSecurityCommandCenter = value
    }

    /**
     * @param value The maximum QPS during scanning. A valid value ranges from 5 to 20 inclusively.
     * Defaults to 15.
     */
    @JvmName("pelqimpgmfikmsjm")
    public suspend fun maxQps(`value`: Output) {
        this.maxQps = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("xmuppwbkkkcmdeou")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The schedule of the ScanConfig
     * Structure is documented below.
     */
    @JvmName("tddhpmpaywgtxsxe")
    public suspend fun schedule(`value`: Output) {
        this.schedule = value
    }

    /**
     * @param value The starting URLs from which the scanner finds site pages.
     * - - -
     */
    @JvmName("jilkbyitucdkaalh")
    public suspend fun startingUrls(`value`: Output>) {
        this.startingUrls = value
    }

    @JvmName("gnugajuimqvfiixj")
    public suspend fun startingUrls(vararg values: Output) {
        this.startingUrls = Output.all(values.asList())
    }

    /**
     * @param values The starting URLs from which the scanner finds site pages.
     * - - -
     */
    @JvmName("qqvvjwmwcpefaxhr")
    public suspend fun startingUrls(values: List>) {
        this.startingUrls = Output.all(values)
    }

    /**
     * @param value Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
     * Each value may be one of: `APP_ENGINE`, `COMPUTE`.
     */
    @JvmName("kjpiokdhryqojyig")
    public suspend fun targetPlatforms(`value`: Output>) {
        this.targetPlatforms = value
    }

    @JvmName("wpsididisbglsqgi")
    public suspend fun targetPlatforms(vararg values: Output) {
        this.targetPlatforms = Output.all(values.asList())
    }

    /**
     * @param values Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
     * Each value may be one of: `APP_ENGINE`, `COMPUTE`.
     */
    @JvmName("igyioehycsccjstx")
    public suspend fun targetPlatforms(values: List>) {
        this.targetPlatforms = Output.all(values)
    }

    /**
     * @param value Type of the user agents used for scanning
     * Default value is `CHROME_LINUX`.
     * Possible values are: `USER_AGENT_UNSPECIFIED`, `CHROME_LINUX`, `CHROME_ANDROID`, `SAFARI_IPHONE`.
     */
    @JvmName("wpkxiclsdbqvnynb")
    public suspend fun userAgent(`value`: Output) {
        this.userAgent = value
    }

    /**
     * @param value The authentication configuration.
     * If specified, service will use the authentication configuration during scanning.
     * Structure is documented below.
     */
    @JvmName("xniuktqqftltcgon")
    public suspend fun authentication(`value`: SecurityScanConfigAuthenticationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authentication = mapped
    }

    /**
     * @param argument The authentication configuration.
     * If specified, service will use the authentication configuration during scanning.
     * Structure is documented below.
     */
    @JvmName("bvdsubovxmxqddpl")
    public suspend fun authentication(argument: suspend SecurityScanConfigAuthenticationArgsBuilder.() -> Unit) {
        val toBeMapped = SecurityScanConfigAuthenticationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.authentication = mapped
    }

    /**
     * @param value The blacklist URL patterns as described in
     * https://cloud.google.com/security-scanner/docs/excluded-urls
     */
    @JvmName("vdvewgcrurejdhaq")
    public suspend fun blacklistPatterns(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.blacklistPatterns = mapped
    }

    /**
     * @param values The blacklist URL patterns as described in
     * https://cloud.google.com/security-scanner/docs/excluded-urls
     */
    @JvmName("kqnvrotwqtcithuu")
    public suspend fun blacklistPatterns(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.blacklistPatterns = mapped
    }

    /**
     * @param value The user provider display name of the ScanConfig.
     */
    @JvmName("lictfmffidlddyxu")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Controls export of scan configurations and results to Cloud Security Command Center.
     * Default value is `ENABLED`.
     * Possible values are: `ENABLED`, `DISABLED`.
     */
    @JvmName("muegjgjxsqklexyr")
    public suspend fun exportToSecurityCommandCenter(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.exportToSecurityCommandCenter = mapped
    }

    /**
     * @param value The maximum QPS during scanning. A valid value ranges from 5 to 20 inclusively.
     * Defaults to 15.
     */
    @JvmName("tfkahekqpqtulgpd")
    public suspend fun maxQps(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxQps = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("wcibtfoyamloebat")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The schedule of the ScanConfig
     * Structure is documented below.
     */
    @JvmName("qksncrydegpkytbq")
    public suspend fun schedule(`value`: SecurityScanConfigScheduleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schedule = mapped
    }

    /**
     * @param argument The schedule of the ScanConfig
     * Structure is documented below.
     */
    @JvmName("guwdjxeiagxrpgfx")
    public suspend fun schedule(argument: suspend SecurityScanConfigScheduleArgsBuilder.() -> Unit) {
        val toBeMapped = SecurityScanConfigScheduleArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.schedule = mapped
    }

    /**
     * @param value The starting URLs from which the scanner finds site pages.
     * - - -
     */
    @JvmName("owxriljthftygsuu")
    public suspend fun startingUrls(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startingUrls = mapped
    }

    /**
     * @param values The starting URLs from which the scanner finds site pages.
     * - - -
     */
    @JvmName("lqrnqmwppkabivva")
    public suspend fun startingUrls(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.startingUrls = mapped
    }

    /**
     * @param value Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
     * Each value may be one of: `APP_ENGINE`, `COMPUTE`.
     */
    @JvmName("khflkobdmwwvblxp")
    public suspend fun targetPlatforms(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetPlatforms = mapped
    }

    /**
     * @param values Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
     * Each value may be one of: `APP_ENGINE`, `COMPUTE`.
     */
    @JvmName("ioxbgruyjbklvnkg")
    public suspend fun targetPlatforms(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetPlatforms = mapped
    }

    /**
     * @param value Type of the user agents used for scanning
     * Default value is `CHROME_LINUX`.
     * Possible values are: `USER_AGENT_UNSPECIFIED`, `CHROME_LINUX`, `CHROME_ANDROID`, `SAFARI_IPHONE`.
     */
    @JvmName("bawbudykyfyewwxg")
    public suspend fun userAgent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userAgent = mapped
    }

    internal fun build(): SecurityScanConfigArgs = SecurityScanConfigArgs(
        authentication = authentication,
        blacklistPatterns = blacklistPatterns,
        displayName = displayName,
        exportToSecurityCommandCenter = exportToSecurityCommandCenter,
        maxQps = maxQps,
        project = project,
        schedule = schedule,
        startingUrls = startingUrls,
        targetPlatforms = targetPlatforms,
        userAgent = userAgent,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy