---
# ----------------------------------------------------------------------------
#
#     ***     AUTO GENERATED CODE    ***    Type: MMv1     ***
#
# ----------------------------------------------------------------------------
#
#     This file is automatically generated by Magic Modules and manual
#     changes will be clobbered when the file is regenerated.
#
#     Please read more about how to change this file in
#     .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Container Registry"
description: |-
  An occurrence is an instance of a Note, or type of analysis that
  can be done for a resource.
---

# google\_container\_analysis\_occurrence

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


```hcl
resource "google_binary_authorization_attestor" "attestor" {
  name = "attestor"
  attestation_authority_note {
    note_reference = google_container_analysis_note.note.name
    public_keys {
      id = data.google_kms_crypto_key_version.version.id
      pkix_public_key {
        public_key_pem      = data.google_kms_crypto_key_version.version.public_key[0].pem
        signature_algorithm = data.google_kms_crypto_key_version.version.public_key[0].algorithm
      }
    }
  }
}

resource "google_container_analysis_note" "note" {
  name = "attestation-note"
  attestation_authority {
    hint {
      human_readable_name = "Attestor Note"
    }
  }
}

data "google_kms_key_ring" "keyring" {
  name = "my-key-ring"
  location = "global"
}

data "google_kms_crypto_key" "crypto-key" {
  name     = "my-key"
  key_ring = data.google_kms_key_ring.keyring.id
}

data "google_kms_crypto_key_version" "version" {
  crypto_key = data.google_kms_crypto_key.crypto-key.id
}

resource "google_container_analysis_occurrence" "occurrence" {
  resource_uri = "gcr.io/my-project/my-image"
  note_name = google_container_analysis_note.note.id

  // See "Creating Attestations" Guide for expected
  // payload and signature formats.
  attestation {
    serialized_payload = filebase64("path/to/my/payload.json")
    signatures {
      public_key_id = data.google_kms_crypto_key_version.version.id
      serialized_payload = filebase64("path/to/my/payload.json.sig")
    }
  }
}
```

## Argument Reference

The following arguments are supported:


* `resource_uri` -
  (Required)
  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.

* `note_name` -
  (Required)
  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.

* `attestation` -
  (Required)
  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](#nested_attestation).


<a name="nested_attestation"></a>The `attestation` block supports:

* `serialized_payload` -
  (Required)
  The serialized payload that is verified by one or
  more signatures. A base64-encoded string.

* `signatures` -
  (Required)
  One or more signatures over serializedPayload.
  Verifier implementations should consider this attestation
  message verified if at least one signature verifies
  serializedPayload. See Signature in common.proto for more
  details on signature structure and verification.
  Structure is [documented below](#nested_signatures).


<a name="nested_signatures"></a>The `signatures` block supports:

* `signature` -
  (Optional)
  The content of the signature, an opaque bytestring.
  The payload that this signature verifies MUST be
  unambiguously provided with the Signature during
  verification. A wrapper message might provide the
  payload explicitly. Alternatively, a message might
  have a canonical serialization that can always be
  unambiguously computed to derive the payload.

* `public_key_id` -
  (Required)
  The identifier for the public key that verifies this
  signature. MUST be an RFC3986 conformant
  URI. * When possible, the key id should be an
  immutable reference, such as a cryptographic digest.
  Examples of valid values:
  * OpenPGP V4 public key fingerprint. See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr
    for more details on this scheme.
      * `openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA`
  * RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER serialization):
      * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"

- - -


* `remediation` -
  (Optional)
  A description of actions that can be taken to remedy the note.

* `project` - (Optional) The ID of the project in which the resource belongs.
    If it is not provided, the provider project is used.


## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

* `id` - an identifier for the resource with format `projects/{{project}}/occurrences/{{name}}`

* `name` -
  The name of the occurrence.

* `kind` -
  The note kind which explicitly denotes which of the occurrence
  details are specified. This field can be used as a filter in list
  requests.

* `create_time` -
  The time when the repository was created.

* `update_time` -
  The time when the repository was last updated.


## Timeouts

This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:

- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.

## Import


Occurrence can be imported using any of these accepted formats:

* `projects/{{project}}/occurrences/{{name}}`
* `{{project}}/{{name}}`
* `{{name}}`


In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Occurrence using one of the formats above. For example:

```tf
import {
  id = "projects/{{project}}/occurrences/{{name}}"
  to = google_container_analysis_occurrence.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Occurrence can be imported using one of the formats above. For example:

```
$ terraform import google_container_analysis_occurrence.default projects/{{project}}/occurrences/{{name}}
$ terraform import google_container_analysis_occurrence.default {{project}}/{{name}}
$ terraform import google_container_analysis_occurrence.default {{name}}
```

## User Project Overrides

This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).
