com.pulumi.gcp.compute.kotlin.SecurityScanConfigArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy