Package com.pulumi.gcp.containeranalysis
Class Occurence
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.containeranalysis.Occurence
-
public class Occurence extends com.pulumi.resources.CustomResource
An occurrence is an instance of a Note, or type of analysis that can be done for a resource. To get more information about Occurrence, see: * [API documentation](https://cloud.google.com/container-analysis/api/reference/rest/) * How-to Guides * [Official Documentation](https://cloud.google.com/container-analysis/) ## Example Usage ### Container Analysis Occurrence Kms ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.containeranalysis.Note; import com.pulumi.gcp.containeranalysis.NoteArgs; import com.pulumi.gcp.containeranalysis.inputs.NoteAttestationAuthorityArgs; import com.pulumi.gcp.containeranalysis.inputs.NoteAttestationAuthorityHintArgs; import com.pulumi.gcp.kms.KmsFunctions; import com.pulumi.gcp.kms.inputs.GetKMSKeyRingArgs; import com.pulumi.gcp.kms.inputs.GetKMSCryptoKeyArgs; import com.pulumi.gcp.kms.inputs.GetKMSCryptoKeyVersionArgs; import com.pulumi.gcp.binaryauthorization.Attestor; import com.pulumi.gcp.binaryauthorization.AttestorArgs; import com.pulumi.gcp.binaryauthorization.inputs.AttestorAttestationAuthorityNoteArgs; import com.pulumi.gcp.containeranalysis.Occurence; import com.pulumi.gcp.containeranalysis.OccurenceArgs; import com.pulumi.gcp.containeranalysis.inputs.OccurenceAttestationArgs; 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 note = new Note("note", NoteArgs.builder() .attestationAuthority(NoteAttestationAuthorityArgs.builder() .hint(NoteAttestationAuthorityHintArgs.builder() .humanReadableName("Attestor Note") .build()) .build()) .build()); final var keyring = KmsFunctions.getKMSKeyRing(GetKMSKeyRingArgs.builder() .name("my-key-ring") .location("global") .build()); final var crypto-key = KmsFunctions.getKMSCryptoKey(GetKMSCryptoKeyArgs.builder() .name("my-key") .keyRing(keyring.applyValue(getKMSKeyRingResult -> getKMSKeyRingResult.id())) .build()); final var version = KmsFunctions.getKMSCryptoKeyVersion(GetKMSCryptoKeyVersionArgs.builder() .cryptoKey(crypto_key.id()) .build()); var attestor = new Attestor("attestor", AttestorArgs.builder() .attestationAuthorityNote(AttestorAttestationAuthorityNoteArgs.builder() .noteReference(note.name()) .publicKeys(AttestorAttestationAuthorityNotePublicKeyArgs.builder() .id(version.applyValue(getKMSCryptoKeyVersionResult -> getKMSCryptoKeyVersionResult.id())) .pkixPublicKey(AttestorAttestationAuthorityNotePublicKeyPkixPublicKeyArgs.builder() .publicKeyPem(version.applyValue(getKMSCryptoKeyVersionResult -> getKMSCryptoKeyVersionResult.publicKeys()[0].pem())) .signatureAlgorithm(version.applyValue(getKMSCryptoKeyVersionResult -> getKMSCryptoKeyVersionResult.publicKeys()[0].algorithm())) .build()) .build()) .build()) .build()); var occurrence = new Occurence("occurrence", OccurenceArgs.builder() .resourceUri("gcr.io/my-project/my-image") .noteName(note.id()) .attestation(OccurenceAttestationArgs.builder() .serializedPayload(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("path/to/my/payload.json")))) .signatures(OccurenceAttestationSignatureArgs.builder() .publicKeyId(version.applyValue(getKMSCryptoKeyVersionResult -> getKMSCryptoKeyVersionResult.id())) .serializedPayload(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("path/to/my/payload.json.sig")))) .build()) .build()) .build()); } } ``` ## Import Occurrence can be imported using any of these accepted formats ```sh $ pulumi import gcp:containeranalysis/occurence:Occurence default projects/{{project}}/occurrences/{{name}} ``` ```sh $ pulumi import gcp:containeranalysis/occurence:Occurence default {{project}}/{{name}} ``` ```sh $ pulumi import gcp:containeranalysis/occurence:Occurence default {{name}} ```
-
-
Constructor Summary
Constructors Constructor Description Occurence(java.lang.String name)
Occurence(java.lang.String name, OccurenceArgs args)
Occurence(java.lang.String name, OccurenceArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<OccurenceAttestation>
attestation()
com.pulumi.core.Output<java.lang.String>
createTime()
static Occurence
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OccurenceState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
kind()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.lang.String>
noteName()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
remediation()
com.pulumi.core.Output<java.lang.String>
resourceUri()
com.pulumi.core.Output<java.lang.String>
updateTime()
-
-
-
Constructor Detail
-
Occurence
public Occurence(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Occurence
public Occurence(java.lang.String name, OccurenceArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Occurence
public Occurence(java.lang.String name, OccurenceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
attestation
public com.pulumi.core.Output<OccurenceAttestation> attestation()
- Returns:
- Occurrence that represents a single "attestation". The authenticity of an attestation can be verified using the attached signature. If the verifier trusts the public key of the signer, then verifying the signature is sufficient to establish trust. In this circumstance, the authority to which this attestation is attached is primarily useful for lookup (how to find this attestation if you already know the authority and artifact to be verified) and intent (for which authority this attestation was intended to sign. Structure is documented below.
-
createTime
public com.pulumi.core.Output<java.lang.String> createTime()
- Returns:
- The time when the repository was created.
-
kind
public com.pulumi.core.Output<java.lang.String> kind()
- Returns:
- The note kind which explicitly denotes which of the occurrence details are specified. This field can be used as a filter in list requests.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- The name of the occurrence.
-
noteName
public com.pulumi.core.Output<java.lang.String> noteName()
- Returns:
- The analysis note associated with this occurrence, in the form of projects/[PROJECT]/notes/[NOTE_ID]. This field can be used as a filter in list requests.
-
project
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
-
remediation
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> remediation()
- Returns:
- A description of actions that can be taken to remedy the note.
-
resourceUri
public com.pulumi.core.Output<java.lang.String> resourceUri()
- Returns:
- Required. Immutable. A URI that represents the resource for which the occurrence applies. For example, https://gcr.io/project/image@sha256:123abc for a Docker image.
-
updateTime
public com.pulumi.core.Output<java.lang.String> updateTime()
- Returns:
- The time when the repository was last updated.
-
get
public static Occurence get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable OccurenceState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-