1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. VulnerabilityScanning
  5. getContainerScanTargets
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.VulnerabilityScanning.getContainerScanTargets

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

This data source provides the list of Container Scan Targets in Oracle Cloud Infrastructure Vulnerability Scanning service.

Retrieves a list of ContainerScanTargetSummary objects in a compartment. A container scan target specifies a group of one or more Docker image repositories in Oracle Cloud Infrastructure Registry (OCIR) that you want routinely scanned for security vulnerabilities.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testContainerScanTargets = oci.VulnerabilityScanning.getContainerScanTargets({
    compartmentId: compartmentId,
    displayName: containerScanTargetDisplayName,
    state: containerScanTargetState,
});
Copy
import pulumi
import pulumi_oci as oci

test_container_scan_targets = oci.VulnerabilityScanning.get_container_scan_targets(compartment_id=compartment_id,
    display_name=container_scan_target_display_name,
    state=container_scan_target_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/vulnerabilityscanning"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vulnerabilityscanning.GetContainerScanTargets(ctx, &vulnerabilityscanning.GetContainerScanTargetsArgs{
			CompartmentId: compartmentId,
			DisplayName:   pulumi.StringRef(containerScanTargetDisplayName),
			State:         pulumi.StringRef(containerScanTargetState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testContainerScanTargets = Oci.VulnerabilityScanning.GetContainerScanTargets.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayName = containerScanTargetDisplayName,
        State = containerScanTargetState,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.VulnerabilityScanning.VulnerabilityScanningFunctions;
import com.pulumi.oci.VulnerabilityScanning.inputs.GetContainerScanTargetsArgs;
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) {
        final var testContainerScanTargets = VulnerabilityScanningFunctions.getContainerScanTargets(GetContainerScanTargetsArgs.builder()
            .compartmentId(compartmentId)
            .displayName(containerScanTargetDisplayName)
            .state(containerScanTargetState)
            .build());

    }
}
Copy
variables:
  testContainerScanTargets:
    fn::invoke:
      function: oci:VulnerabilityScanning:getContainerScanTargets
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${containerScanTargetDisplayName}
        state: ${containerScanTargetState}
Copy

Using getContainerScanTargets

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getContainerScanTargets(args: GetContainerScanTargetsArgs, opts?: InvokeOptions): Promise<GetContainerScanTargetsResult>
function getContainerScanTargetsOutput(args: GetContainerScanTargetsOutputArgs, opts?: InvokeOptions): Output<GetContainerScanTargetsResult>
Copy
def get_container_scan_targets(compartment_id: Optional[str] = None,
                               display_name: Optional[str] = None,
                               filters: Optional[Sequence[_vulnerabilityscanning.GetContainerScanTargetsFilter]] = None,
                               state: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetContainerScanTargetsResult
def get_container_scan_targets_output(compartment_id: Optional[pulumi.Input[str]] = None,
                               display_name: Optional[pulumi.Input[str]] = None,
                               filters: Optional[pulumi.Input[Sequence[pulumi.Input[_vulnerabilityscanning.GetContainerScanTargetsFilterArgs]]]] = None,
                               state: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetContainerScanTargetsResult]
Copy
func GetContainerScanTargets(ctx *Context, args *GetContainerScanTargetsArgs, opts ...InvokeOption) (*GetContainerScanTargetsResult, error)
func GetContainerScanTargetsOutput(ctx *Context, args *GetContainerScanTargetsOutputArgs, opts ...InvokeOption) GetContainerScanTargetsResultOutput
Copy

> Note: This function is named GetContainerScanTargets in the Go SDK.

public static class GetContainerScanTargets 
{
    public static Task<GetContainerScanTargetsResult> InvokeAsync(GetContainerScanTargetsArgs args, InvokeOptions? opts = null)
    public static Output<GetContainerScanTargetsResult> Invoke(GetContainerScanTargetsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetContainerScanTargetsResult> getContainerScanTargets(GetContainerScanTargetsArgs args, InvokeOptions options)
public static Output<GetContainerScanTargetsResult> getContainerScanTargets(GetContainerScanTargetsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:VulnerabilityScanning/getContainerScanTargets:getContainerScanTargets
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The ID of the compartment in which to list resources.
DisplayName string
A filter to return only resources that match the entire display name given.
Filters Changes to this property will trigger replacement. List<GetContainerScanTargetsFilter>
State string
A filter to return only resources whose lifecycleState matches the given lifecycleState.
CompartmentId This property is required. string
The ID of the compartment in which to list resources.
DisplayName string
A filter to return only resources that match the entire display name given.
Filters Changes to this property will trigger replacement. []GetContainerScanTargetsFilter
State string
A filter to return only resources whose lifecycleState matches the given lifecycleState.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
displayName String
A filter to return only resources that match the entire display name given.
filters Changes to this property will trigger replacement. List<GetContainerScanTargetsFilter>
state String
A filter to return only resources whose lifecycleState matches the given lifecycleState.
compartmentId This property is required. string
The ID of the compartment in which to list resources.
displayName string
A filter to return only resources that match the entire display name given.
filters Changes to this property will trigger replacement. GetContainerScanTargetsFilter[]
state string
A filter to return only resources whose lifecycleState matches the given lifecycleState.
compartment_id This property is required. str
The ID of the compartment in which to list resources.
display_name str
A filter to return only resources that match the entire display name given.
filters Changes to this property will trigger replacement. Sequence[vulnerabilityscanning.GetContainerScanTargetsFilter]
state str
A filter to return only resources whose lifecycleState matches the given lifecycleState.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
displayName String
A filter to return only resources that match the entire display name given.
filters Changes to this property will trigger replacement. List<Property Map>
state String
A filter to return only resources whose lifecycleState matches the given lifecycleState.

getContainerScanTargets Result

The following output properties are available:

CompartmentId string
The OCID of the compartment to perform the scans in. All listed repositories must be in the compartment.
ContainerScanTargetSummaryCollections List<GetContainerScanTargetsContainerScanTargetSummaryCollection>
The list of container_scan_target_summary_collection.
Id string
The provider-assigned unique ID for this managed resource.
DisplayName string
User friendly name of container scan target
Filters List<GetContainerScanTargetsFilter>
State string
The current state of the config.
CompartmentId string
The OCID of the compartment to perform the scans in. All listed repositories must be in the compartment.
ContainerScanTargetSummaryCollections []GetContainerScanTargetsContainerScanTargetSummaryCollection
The list of container_scan_target_summary_collection.
Id string
The provider-assigned unique ID for this managed resource.
DisplayName string
User friendly name of container scan target
Filters []GetContainerScanTargetsFilter
State string
The current state of the config.
compartmentId String
The OCID of the compartment to perform the scans in. All listed repositories must be in the compartment.
containerScanTargetSummaryCollections List<GetContainerScanTargetsContainerScanTargetSummaryCollection>
The list of container_scan_target_summary_collection.
id String
The provider-assigned unique ID for this managed resource.
displayName String
User friendly name of container scan target
filters List<GetContainerScanTargetsFilter>
state String
The current state of the config.
compartmentId string
The OCID of the compartment to perform the scans in. All listed repositories must be in the compartment.
containerScanTargetSummaryCollections GetContainerScanTargetsContainerScanTargetSummaryCollection[]
The list of container_scan_target_summary_collection.
id string
The provider-assigned unique ID for this managed resource.
displayName string
User friendly name of container scan target
filters GetContainerScanTargetsFilter[]
state string
The current state of the config.
compartment_id str
The OCID of the compartment to perform the scans in. All listed repositories must be in the compartment.
container_scan_target_summary_collections Sequence[vulnerabilityscanning.GetContainerScanTargetsContainerScanTargetSummaryCollection]
The list of container_scan_target_summary_collection.
id str
The provider-assigned unique ID for this managed resource.
display_name str
User friendly name of container scan target
filters Sequence[vulnerabilityscanning.GetContainerScanTargetsFilter]
state str
The current state of the config.
compartmentId String
The OCID of the compartment to perform the scans in. All listed repositories must be in the compartment.
containerScanTargetSummaryCollections List<Property Map>
The list of container_scan_target_summary_collection.
id String
The provider-assigned unique ID for this managed resource.
displayName String
User friendly name of container scan target
filters List<Property Map>
state String
The current state of the config.

Supporting Types

GetContainerScanTargetsContainerScanTargetSummaryCollection

items This property is required. List<Property Map>

GetContainerScanTargetsContainerScanTargetSummaryCollectionItem

CompartmentId This property is required. string
The ID of the compartment in which to list resources.
ContainerScanRecipeId This property is required. string
ID of the container scan recipe this target applies.
DefinedTags This property is required. Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
Description This property is required. string
Target description.
DisplayName This property is required. string
A filter to return only resources that match the entire display name given.
FreeformTags This property is required. Dictionary<string, string>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
Id This property is required. string
The OCID of container scan target. Immutable and generated on creation.
State This property is required. string
A filter to return only resources whose lifecycleState matches the given lifecycleState.
SystemTags This property is required. Dictionary<string, string>
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
TargetRegistries This property is required. List<GetContainerScanTargetsContainerScanTargetSummaryCollectionItemTargetRegistry>
Registry information for a container scan target
TimeCreated This property is required. string
Date and time the target was created, format as described in RFC 3339
TimeUpdated This property is required. string
Date and time the target was last updated, format as described in RFC 3339
CompartmentId This property is required. string
The ID of the compartment in which to list resources.
ContainerScanRecipeId This property is required. string
ID of the container scan recipe this target applies.
DefinedTags This property is required. map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
Description This property is required. string
Target description.
DisplayName This property is required. string
A filter to return only resources that match the entire display name given.
FreeformTags This property is required. map[string]string
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
Id This property is required. string
The OCID of container scan target. Immutable and generated on creation.
State This property is required. string
A filter to return only resources whose lifecycleState matches the given lifecycleState.
SystemTags This property is required. map[string]string
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
TargetRegistries This property is required. []GetContainerScanTargetsContainerScanTargetSummaryCollectionItemTargetRegistry
Registry information for a container scan target
TimeCreated This property is required. string
Date and time the target was created, format as described in RFC 3339
TimeUpdated This property is required. string
Date and time the target was last updated, format as described in RFC 3339
compartmentId This property is required. String
The ID of the compartment in which to list resources.
containerScanRecipeId This property is required. String
ID of the container scan recipe this target applies.
definedTags This property is required. Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
description This property is required. String
Target description.
displayName This property is required. String
A filter to return only resources that match the entire display name given.
freeformTags This property is required. Map<String,String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
id This property is required. String
The OCID of container scan target. Immutable and generated on creation.
state This property is required. String
A filter to return only resources whose lifecycleState matches the given lifecycleState.
systemTags This property is required. Map<String,String>
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
targetRegistries This property is required. List<GetContainerScanTargetsContainerScanTargetSummaryCollectionItemTargetRegistry>
Registry information for a container scan target
timeCreated This property is required. String
Date and time the target was created, format as described in RFC 3339
timeUpdated This property is required. String
Date and time the target was last updated, format as described in RFC 3339
compartmentId This property is required. string
The ID of the compartment in which to list resources.
containerScanRecipeId This property is required. string
ID of the container scan recipe this target applies.
definedTags This property is required. {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
description This property is required. string
Target description.
displayName This property is required. string
A filter to return only resources that match the entire display name given.
freeformTags This property is required. {[key: string]: string}
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
id This property is required. string
The OCID of container scan target. Immutable and generated on creation.
state This property is required. string
A filter to return only resources whose lifecycleState matches the given lifecycleState.
systemTags This property is required. {[key: string]: string}
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
targetRegistries This property is required. GetContainerScanTargetsContainerScanTargetSummaryCollectionItemTargetRegistry[]
Registry information for a container scan target
timeCreated This property is required. string
Date and time the target was created, format as described in RFC 3339
timeUpdated This property is required. string
Date and time the target was last updated, format as described in RFC 3339
compartment_id This property is required. str
The ID of the compartment in which to list resources.
container_scan_recipe_id This property is required. str
ID of the container scan recipe this target applies.
defined_tags This property is required. Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
description This property is required. str
Target description.
display_name This property is required. str
A filter to return only resources that match the entire display name given.
freeform_tags This property is required. Mapping[str, str]
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
id This property is required. str
The OCID of container scan target. Immutable and generated on creation.
state This property is required. str
A filter to return only resources whose lifecycleState matches the given lifecycleState.
system_tags This property is required. Mapping[str, str]
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
target_registries This property is required. Sequence[vulnerabilityscanning.GetContainerScanTargetsContainerScanTargetSummaryCollectionItemTargetRegistry]
Registry information for a container scan target
time_created This property is required. str
Date and time the target was created, format as described in RFC 3339
time_updated This property is required. str
Date and time the target was last updated, format as described in RFC 3339
compartmentId This property is required. String
The ID of the compartment in which to list resources.
containerScanRecipeId This property is required. String
ID of the container scan recipe this target applies.
definedTags This property is required. Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
description This property is required. String
Target description.
displayName This property is required. String
A filter to return only resources that match the entire display name given.
freeformTags This property is required. Map<String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
id This property is required. String
The OCID of container scan target. Immutable and generated on creation.
state This property is required. String
A filter to return only resources whose lifecycleState matches the given lifecycleState.
systemTags This property is required. Map<String>
Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
targetRegistries This property is required. List<Property Map>
Registry information for a container scan target
timeCreated This property is required. String
Date and time the target was created, format as described in RFC 3339
timeUpdated This property is required. String
Date and time the target was last updated, format as described in RFC 3339

GetContainerScanTargetsContainerScanTargetSummaryCollectionItemTargetRegistry

CompartmentId This property is required. string
The ID of the compartment in which to list resources.
Repositories This property is required. List<string>
List of repositories to scan images in. If left empty, the target defaults to scanning all repos in the compartmentId
Type This property is required. string
The scan level
Url This property is required. string
URL of the registry.
CompartmentId This property is required. string
The ID of the compartment in which to list resources.
Repositories This property is required. []string
List of repositories to scan images in. If left empty, the target defaults to scanning all repos in the compartmentId
Type This property is required. string
The scan level
Url This property is required. string
URL of the registry.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
repositories This property is required. List<String>
List of repositories to scan images in. If left empty, the target defaults to scanning all repos in the compartmentId
type This property is required. String
The scan level
url This property is required. String
URL of the registry.
compartmentId This property is required. string
The ID of the compartment in which to list resources.
repositories This property is required. string[]
List of repositories to scan images in. If left empty, the target defaults to scanning all repos in the compartmentId
type This property is required. string
The scan level
url This property is required. string
URL of the registry.
compartment_id This property is required. str
The ID of the compartment in which to list resources.
repositories This property is required. Sequence[str]
List of repositories to scan images in. If left empty, the target defaults to scanning all repos in the compartmentId
type This property is required. str
The scan level
url This property is required. str
URL of the registry.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
repositories This property is required. List<String>
List of repositories to scan images in. If left empty, the target defaults to scanning all repos in the compartmentId
type This property is required. String
The scan level
url This property is required. String
URL of the registry.

GetContainerScanTargetsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi