Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.policyinsights.kotlin
import com.pulumi.azurenative.policyinsights.kotlin.outputs.AttestationEvidenceResponse
import com.pulumi.azurenative.policyinsights.kotlin.outputs.SystemDataResponse
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.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.azurenative.policyinsights.kotlin.outputs.AttestationEvidenceResponse.Companion.toKotlin as attestationEvidenceResponseToKotlin
import com.pulumi.azurenative.policyinsights.kotlin.outputs.SystemDataResponse.Companion.toKotlin as systemDataResponseToKotlin
/**
* Builder for [AttestationAtResource].
*/
@PulumiTagMarker
public class AttestationAtResourceResourceBuilder internal constructor() {
public var name: String? = null
public var args: AttestationAtResourceArgs = AttestationAtResourceArgs()
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 AttestationAtResourceArgsBuilder.() -> Unit) {
val builder = AttestationAtResourceArgsBuilder()
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(): AttestationAtResource {
val builtJavaResource =
com.pulumi.azurenative.policyinsights.AttestationAtResource(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AttestationAtResource(builtJavaResource)
}
}
/**
* An attestation resource.
* Azure REST API version: 2022-09-01. Prior API version in Azure Native 1.x: 2021-01-01.
* ## Example Usage
* ### Create attestation at individual resource scope
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var attestationAtResource = new AzureNative.PolicyInsights.AttestationAtResource("attestationAtResource", new()
* {
* AssessmentDate = "2021-06-10T00:00:00Z",
* AttestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e",
* Comments = "This subscription has passed a security audit.",
* ComplianceState = AzureNative.PolicyInsights.ComplianceState.Compliant,
* Evidence = new[]
* {
* new AzureNative.PolicyInsights.Inputs.AttestationEvidenceArgs
* {
* Description = "The results of the security audit.",
* SourceUri = "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011",
* },
* },
* ExpiresOn = "2021-06-15T00:00:00Z",
* Metadata = new Dictionary
* {
* ["departmentId"] = "NYC-MARKETING-1",
* },
* Owner = "55a32e28-3aa5-4eea-9b5a-4cd85153b966",
* PolicyAssignmentId = "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5",
* PolicyDefinitionReferenceId = "0b158b46-ff42-4799-8e39-08a5c23b4551",
* ResourceId = "subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM",
* });
* });
* ```
* ```go
* package main
* import (
* policyinsights "github.com/pulumi/pulumi-azure-native-sdk/policyinsights/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := policyinsights.NewAttestationAtResource(ctx, "attestationAtResource", &policyinsights.AttestationAtResourceArgs{
* AssessmentDate: pulumi.String("2021-06-10T00:00:00Z"),
* AttestationName: pulumi.String("790996e6-9871-4b1f-9cd9-ec42cd6ced1e"),
* Comments: pulumi.String("This subscription has passed a security audit."),
* ComplianceState: pulumi.String(policyinsights.ComplianceStateCompliant),
* Evidence: policyinsights.AttestationEvidenceArray{
* &policyinsights.AttestationEvidenceArgs{
* Description: pulumi.String("The results of the security audit."),
* SourceUri: pulumi.String("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"),
* },
* },
* ExpiresOn: pulumi.String("2021-06-15T00:00:00Z"),
* Metadata: pulumi.Any(map[string]interface{}{
* "departmentId": "NYC-MARKETING-1",
* }),
* Owner: pulumi.String("55a32e28-3aa5-4eea-9b5a-4cd85153b966"),
* PolicyAssignmentId: pulumi.String("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5"),
* PolicyDefinitionReferenceId: pulumi.String("0b158b46-ff42-4799-8e39-08a5c23b4551"),
* ResourceId: pulumi.String("subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM"),
* })
* 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.azurenative.policyinsights.AttestationAtResource;
* import com.pulumi.azurenative.policyinsights.AttestationAtResourceArgs;
* import com.pulumi.azurenative.policyinsights.inputs.AttestationEvidenceArgs;
* 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 attestationAtResource = new AttestationAtResource("attestationAtResource", AttestationAtResourceArgs.builder()
* .assessmentDate("2021-06-10T00:00:00Z")
* .attestationName("790996e6-9871-4b1f-9cd9-ec42cd6ced1e")
* .comments("This subscription has passed a security audit.")
* .complianceState("Compliant")
* .evidence(AttestationEvidenceArgs.builder()
* .description("The results of the security audit.")
* .sourceUri("https://gist.github.com/contoso/9573e238762c60166c090ae16b814011")
* .build())
* .expiresOn("2021-06-15T00:00:00Z")
* .metadata(Map.of("departmentId", "NYC-MARKETING-1"))
* .owner("55a32e28-3aa5-4eea-9b5a-4cd85153b966")
* .policyAssignmentId("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/microsoft.authorization/policyassignments/b101830944f246d8a14088c5")
* .policyDefinitionReferenceId("0b158b46-ff42-4799-8e39-08a5c23b4551")
* .resourceId("subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myrg/providers/microsoft.compute/virtualMachines/devVM")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:policyinsights:AttestationAtResource 790996e6-9871-4b1f-9cd9-ec42cd6ced1e /{resourceId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}
* ```
*/
public class AttestationAtResource internal constructor(
override val javaResource: com.pulumi.azurenative.policyinsights.AttestationAtResource,
) : KotlinCustomResource(javaResource, AttestationAtResourceMapper) {
/**
* The time the evidence was assessed
*/
public val assessmentDate: Output?
get() = javaResource.assessmentDate().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Comments describing why this attestation was created.
*/
public val comments: Output?
get() = javaResource.comments().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The compliance state that should be set on the resource.
*/
public val complianceState: Output?
get() = javaResource.complianceState().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The evidence supporting the compliance state set in this attestation.
*/
public val evidence: Output>?
get() = javaResource.evidence().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> attestationEvidenceResponseToKotlin(args0) })
})
}).orElse(null)
})
/**
* The time the compliance state should expire.
*/
public val expiresOn: Output?
get() = javaResource.expiresOn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The time the compliance state was last changed in this attestation.
*/
public val lastComplianceStateChangeAt: Output
get() = javaResource.lastComplianceStateChangeAt().applyValue({ args0 -> args0 })
/**
* Additional metadata for this attestation
*/
public val metadata: Output?
get() = javaResource.metadata().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The name of the resource
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The person responsible for setting the state of the resource. This value is typically an Azure Active Directory object ID.
*/
public val owner: Output?
get() = javaResource.owner().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The resource ID of the policy assignment that the attestation is setting the state for.
*/
public val policyAssignmentId: Output
get() = javaResource.policyAssignmentId().applyValue({ args0 -> args0 })
/**
* The policy definition reference ID from a policy set definition that the attestation is setting the state for. If the policy assignment assigns a policy set definition the attestation can choose a definition within the set definition with this property or omit this and set the state for the entire set definition.
*/
public val policyDefinitionReferenceId: Output?
get() = javaResource.policyDefinitionReferenceId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The status of the attestation.
*/
public val provisioningState: Output
get() = javaResource.provisioningState().applyValue({ args0 -> args0 })
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
public val systemData: Output
get() = javaResource.systemData().applyValue({ args0 ->
args0.let({ args0 ->
systemDataResponseToKotlin(args0)
})
})
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*/
public val type: Output
get() = javaResource.type().applyValue({ args0 -> args0 })
}
public object AttestationAtResourceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azurenative.policyinsights.AttestationAtResource::class == javaResource::class
override fun map(javaResource: Resource): AttestationAtResource =
AttestationAtResource(
javaResource as
com.pulumi.azurenative.policyinsights.AttestationAtResource,
)
}
/**
* @see [AttestationAtResource].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AttestationAtResource].
*/
public suspend fun attestationAtResource(
name: String,
block: suspend AttestationAtResourceResourceBuilder.() -> Unit,
): AttestationAtResource {
val builder = AttestationAtResourceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AttestationAtResource].
* @param name The _unique_ name of the resulting resource.
*/
public fun attestationAtResource(name: String): AttestationAtResource {
val builder = AttestationAtResourceResourceBuilder()
builder.name(name)
return builder.build()
}