awsx.ecr.RegistryImage
Explore with Pulumi AI
Manages the lifecycle of a docker image in a registry. You can upload images to a registry (= docker push
) and also delete them again. In contrast to awsx.ecr.Image
, this resource does not require to build the image, but can be used to push an existing image to an ECR repository. The image will be pushed whenever the source image changes or is updated.
Example Usage
Pushing an image to an ECR repository
using Pulumi;
using Pulumi.Awsx.Ecr;
return await Pulumi.Deployment.RunAsync(() =>
{
var repository = new Repository("repository", new RepositoryArgs
{
ForceDelete = true,
});
var registryImage = new RegistryImage("registryImage", new RegistryImageArgs
{
RepositoryUrl = repository.Url,
SourceImage = "my-awesome-image:v1.0.0",
});
return new Dictionary<string, object?>{};
});
package main
import (
"github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
repository, err := ecr.NewRepository(ctx, "repository", &ecr.RepositoryArgs{
ForceDelete: pulumi.Bool(true),
})
if err != nil {
return err
}
registryImage, err := ecr.NewRegistryImage(ctx, "registryImage", &ecr.RegistryImageArgs{
RepositoryUrl: repository.Url,
SourceImage: pulumi.String("my-awesome-image:v1.0.0"),
})
if err != nil {
return err
}
return nil
})
}
import com.pulumi.Pulumi;
import com.pulumi.awsx.ecr.Repository;
import com.pulumi.awsx.ecr.RepositoryArgs;
import com.pulumi.awsx.ecr.RegistryImage;
import com.pulumi.awsx.ecr.RegistryImageArgs;
public class Main {
public static void main(String[] args) {
Pulumi.run(ctx -> {
// Create an ECR repository with force delete enabled
var repository = new Repository("repository", RepositoryArgs.builder()
.forceDelete(true)
.build());
// Create a RegistryImage based on the ECR repository URL and source image
var registryImage = new RegistryImage("registryImage", RegistryImageArgs.builder()
.repositoryUrl(repository.url())
.sourceImage("my-awesome-image:v1.0.0")
.build());
});
}
}
import * as pulumi from "@pulumi/pulumi";
import * as awsx from "@pulumi/awsx";
const repository = new awsx.ecr.Repository("repository", { forceDelete: true });
const preTaggedImage = new awsx.ecr.RegistryImage("registry-image", {
repositoryUrl: repository.url,
sourceImage: "my-awesome-image:v1.0.0",
});
import pulumi
import pulumi_awsx as awsx
repository = awsx.ecr.Repository("repository", force_delete=True)
registry_image = awsx.ecr.RegistryImage("registry_image",
repository_url=repository.url,
source_image="my-awesome-image:v1.0.0")
name: example
runtime: yaml
resources:
repository:
type: awsx:ecr:Repository
properties:
forceDelete: true
registryImage:
type: awsx:ecr:RegistryImage
properties:
repositoryUrl: ${repository.url}
sourceImage: "my-awesome-image:v1.0.0"
Create RegistryImage Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RegistryImage(name: string, args: RegistryImageArgs, opts?: ComponentResourceOptions);
@overload
def RegistryImage(resource_name: str,
args: RegistryImageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RegistryImage(resource_name: str,
opts: Optional[ResourceOptions] = None,
repository_url: Optional[str] = None,
source_image: Optional[str] = None,
insecure_skip_verify: Optional[bool] = None,
keep_remotely: Optional[bool] = None,
tag: Optional[str] = None,
triggers: Optional[Mapping[str, str]] = None)
func NewRegistryImage(ctx *Context, name string, args RegistryImageArgs, opts ...ResourceOption) (*RegistryImage, error)
public RegistryImage(string name, RegistryImageArgs args, ComponentResourceOptions? opts = null)
public RegistryImage(String name, RegistryImageArgs args)
public RegistryImage(String name, RegistryImageArgs args, ComponentResourceOptions options)
type: awsx:ecr:RegistryImage
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RegistryImageArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RegistryImageArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RegistryImageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegistryImageArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RegistryImageArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var registryImageResource = new Awsx.Ecr.RegistryImage("registryImageResource", new()
{
RepositoryUrl = "string",
SourceImage = "string",
InsecureSkipVerify = false,
KeepRemotely = false,
Tag = "string",
Triggers =
{
{ "string", "string" },
},
});
example, err := ecr.NewRegistryImage(ctx, "registryImageResource", &ecr.RegistryImageArgs{
RepositoryUrl: pulumi.String("string"),
SourceImage: pulumi.String("string"),
InsecureSkipVerify: pulumi.Bool(false),
KeepRemotely: pulumi.Bool(false),
Tag: pulumi.String("string"),
Triggers: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var registryImageResource = new RegistryImage("registryImageResource", RegistryImageArgs.builder()
.repositoryUrl("string")
.sourceImage("string")
.insecureSkipVerify(false)
.keepRemotely(false)
.tag("string")
.triggers(Map.of("string", "string"))
.build());
registry_image_resource = awsx.ecr.RegistryImage("registryImageResource",
repository_url="string",
source_image="string",
insecure_skip_verify=False,
keep_remotely=False,
tag="string",
triggers={
"string": "string",
})
const registryImageResource = new awsx.ecr.RegistryImage("registryImageResource", {
repositoryUrl: "string",
sourceImage: "string",
insecureSkipVerify: false,
keepRemotely: false,
tag: "string",
triggers: {
string: "string",
},
});
type: awsx:ecr:RegistryImage
properties:
insecureSkipVerify: false
keepRemotely: false
repositoryUrl: string
sourceImage: string
tag: string
triggers:
string: string
RegistryImage Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RegistryImage resource accepts the following input properties:
- Repository
Url string - The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- Source
Image string - The source image to push to the registry.
- Insecure
Skip boolVerify - If
true
, the verification of TLS certificates of the server/registry is disabled. Defaults tofalse
- Keep
Remotely bool - If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to
false
- Tag string
- The tag to use for the pushed image. If not provided, it defaults to
latest
. - Triggers Dictionary<string, string>
- A map of arbitrary strings that, when changed, will force the
docker.RegistryImage
resource to be replaced. This can be used to repush a local image
- Repository
Url string - The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- Source
Image string - The source image to push to the registry.
- Insecure
Skip boolVerify - If
true
, the verification of TLS certificates of the server/registry is disabled. Defaults tofalse
- Keep
Remotely bool - If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to
false
- Tag string
- The tag to use for the pushed image. If not provided, it defaults to
latest
. - Triggers map[string]string
- A map of arbitrary strings that, when changed, will force the
docker.RegistryImage
resource to be replaced. This can be used to repush a local image
- repository
Url String - The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- source
Image String - The source image to push to the registry.
- insecure
Skip BooleanVerify - If
true
, the verification of TLS certificates of the server/registry is disabled. Defaults tofalse
- keep
Remotely Boolean - If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to
false
- tag String
- The tag to use for the pushed image. If not provided, it defaults to
latest
. - triggers Map<String,String>
- A map of arbitrary strings that, when changed, will force the
docker.RegistryImage
resource to be replaced. This can be used to repush a local image
- repository
Url string - The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- source
Image string - The source image to push to the registry.
- insecure
Skip booleanVerify - If
true
, the verification of TLS certificates of the server/registry is disabled. Defaults tofalse
- keep
Remotely boolean - If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to
false
- tag string
- The tag to use for the pushed image. If not provided, it defaults to
latest
. - triggers {[key: string]: string}
- A map of arbitrary strings that, when changed, will force the
docker.RegistryImage
resource to be replaced. This can be used to repush a local image
- repository_
url str - The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- source_
image str - The source image to push to the registry.
- insecure_
skip_ boolverify - If
true
, the verification of TLS certificates of the server/registry is disabled. Defaults tofalse
- keep_
remotely bool - If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to
false
- tag str
- The tag to use for the pushed image. If not provided, it defaults to
latest
. - triggers Mapping[str, str]
- A map of arbitrary strings that, when changed, will force the
docker.RegistryImage
resource to be replaced. This can be used to repush a local image
- repository
Url String - The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).
- source
Image String - The source image to push to the registry.
- insecure
Skip BooleanVerify - If
true
, the verification of TLS certificates of the server/registry is disabled. Defaults tofalse
- keep
Remotely Boolean - If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to
false
- tag String
- The tag to use for the pushed image. If not provided, it defaults to
latest
. - triggers Map<String>
- A map of arbitrary strings that, when changed, will force the
docker.RegistryImage
resource to be replaced. This can be used to repush a local image
Outputs
All input properties are implicitly available as output properties. Additionally, the RegistryImage resource produces the following output properties:
Package Details
- Repository
- AWSx (Pulumi Crosswalk for AWS) pulumi/pulumi-awsx
- License
- Apache-2.0