PullTimeUpdateExclusion class
Manages an AWS ECR (Elastic Container Registry) Pull Time Update Exclusion.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.iam.Role("example", {
name: "example-role",
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Principal: {
Service: "ec2.amazonaws.com",
},
}],
}),
});
const exampleRolePolicy = new aws.iam.RolePolicy("example", {
name: "example-role-policy",
role: example.id,
policy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Action: [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
],
Resource: "*",
}],
}),
});
const examplePullTimeUpdateExclusion = new aws.ecr.PullTimeUpdateExclusion("example", {principalArn: example.arn});
import pulumi
import json
import pulumi_aws as aws
example = aws.iam.Role("example",
name="example-role",
assume_role_policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com",
},
}],
}))
example_role_policy = aws.iam.RolePolicy("example",
name="example-role-policy",
role=example.id,
policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
],
"Resource": "*",
}],
}))
example_pull_time_update_exclusion = aws.ecr.PullTimeUpdateExclusion("example", principal_arn=example.arn)
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Iam.Role("example", new()
{
Name = "example-role",
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = "sts:AssumeRole",
["Effect"] = "Allow",
["Principal"] = new Dictionary<string, object?>
{
["Service"] = "ec2.amazonaws.com",
},
},
},
}),
});
var exampleRolePolicy = new Aws.Iam.RolePolicy("example", new()
{
Name = "example-role-policy",
Role = example.Id,
Policy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Effect"] = "Allow",
["Action"] = new[]
{
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
},
["Resource"] = "*",
},
},
}),
});
var examplePullTimeUpdateExclusion = new Aws.Ecr.PullTimeUpdateExclusion("example", new()
{
PrincipalArn = example.Arn,
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ecr"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": map[string]string{
"Service": "ec2.amazonaws.com",
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
example, err := iam.NewRole(ctx, "example", &iam.RoleArgs{
Name: pulumi.String("example-role"),
AssumeRolePolicy: pulumi.String(json0),
})
if err != nil {
return err
}
tmpJSON1, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Effect": "Allow",
"Action": []string{
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
},
"Resource": "*",
},
},
})
if err != nil {
return err
}
json1 := string(tmpJSON1)
_, err = iam.NewRolePolicy(ctx, "example", &iam.RolePolicyArgs{
Name: pulumi.String("example-role-policy"),
Role: example.ID().ToIDOutput().ToStringOutput(),
Policy: pulumi.String(json1),
})
if err != nil {
return err
}
_, err = ecr.NewPullTimeUpdateExclusion(ctx, "example", &ecr.PullTimeUpdateExclusionArgs{
PrincipalArn: example.Arn,
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_iam_role" "example" {
name = "example-role"
assume_role_policy = jsonencode({
"Version" = "2012-10-17"
"Statement" = [{
"Action" = "sts:AssumeRole"
"Effect" = "Allow"
"Principal" = {
"Service" = "ec2.amazonaws.com"
}
}]
})
}
resource "aws_iam_rolepolicy" "example" {
name = "example-role-policy"
role = aws_iam_role.example.id
policy = jsonencode({
"Version" = "2012-10-17"
"Statement" = [{
"Effect" = "Allow"
"Action" = ["ecr:GetAuthorizationToken", "ecr:BatchCheckLayerAvailability", "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage"]
"Resource" = "*"
}]
})
}
resource "aws_ecr_pulltimeupdateexclusion" "example" {
principal_arn = aws_iam_role.example.arn
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import com.pulumi.aws.ecr.PullTimeUpdateExclusion;
import com.pulumi.aws.ecr.PullTimeUpdateExclusionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Role("example", RoleArgs.builder()
.name("example-role")
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "ec2.amazonaws.com")
))
)))
)))
.build());
var exampleRolePolicy = new RolePolicy("exampleRolePolicy", RolePolicyArgs.builder()
.name("example-role-policy")
.role(example.id())
.policy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Effect", "Allow"),
jsonProperty("Action", jsonArray(
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage"
)),
jsonProperty("Resource", "*")
)))
)))
.build());
var examplePullTimeUpdateExclusion = new PullTimeUpdateExclusion("examplePullTimeUpdateExclusion", PullTimeUpdateExclusionArgs.builder()
.principalArn(example.arn())
.build());
}
}
resources:
example:
type: aws:iam:Role
properties:
name: example-role
assumeRolePolicy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ec2.amazonaws.com
exampleRolePolicy:
type: aws:iam:RolePolicy
name: example
properties:
name: example-role-policy
role: ${example.id}
policy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- ecr:GetAuthorizationToken
- ecr:BatchCheckLayerAvailability
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
Resource: '*'
examplePullTimeUpdateExclusion:
type: aws:ecr:PullTimeUpdateExclusion
name: example
properties:
principalArn: ${example.arn}
With IAM User
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.iam.User("example", {name: "example-user"});
const exampleUserPolicy = new aws.iam.UserPolicy("example", {
name: "example-user-policy",
user: example.name,
policy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Action: [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
],
Resource: "*",
}],
}),
});
const examplePullTimeUpdateExclusion = new aws.ecr.PullTimeUpdateExclusion("example", {principalArn: example.arn});
import pulumi
import json
import pulumi_aws as aws
example = aws.iam.User("example", name="example-user")
example_user_policy = aws.iam.UserPolicy("example",
name="example-user-policy",
user=example.name,
policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
],
"Resource": "*",
}],
}))
example_pull_time_update_exclusion = aws.ecr.PullTimeUpdateExclusion("example", principal_arn=example.arn)
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Iam.User("example", new()
{
Name = "example-user",
});
var exampleUserPolicy = new Aws.Iam.UserPolicy("example", new()
{
Name = "example-user-policy",
User = example.Name,
Policy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Effect"] = "Allow",
["Action"] = new[]
{
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
},
["Resource"] = "*",
},
},
}),
});
var examplePullTimeUpdateExclusion = new Aws.Ecr.PullTimeUpdateExclusion("example", new()
{
PrincipalArn = example.Arn,
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ecr"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := iam.NewUser(ctx, "example", &iam.UserArgs{
Name: pulumi.String("example-user"),
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Effect": "Allow",
"Action": []string{
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
},
"Resource": "*",
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = iam.NewUserPolicy(ctx, "example", &iam.UserPolicyArgs{
Name: pulumi.String("example-user-policy"),
User: example.Name,
Policy: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = ecr.NewPullTimeUpdateExclusion(ctx, "example", &ecr.PullTimeUpdateExclusionArgs{
PrincipalArn: example.Arn,
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_iam_user" "example" {
name = "example-user"
}
resource "aws_iam_userpolicy" "example" {
name = "example-user-policy"
user = aws_iam_user.example.name
policy = jsonencode({
"Version" = "2012-10-17"
"Statement" = [{
"Effect" = "Allow"
"Action" = ["ecr:GetAuthorizationToken", "ecr:BatchCheckLayerAvailability", "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage"]
"Resource" = "*"
}]
})
}
resource "aws_ecr_pulltimeupdateexclusion" "example" {
principal_arn = aws_iam_user.example.arn
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.User;
import com.pulumi.aws.iam.UserArgs;
import com.pulumi.aws.iam.UserPolicy;
import com.pulumi.aws.iam.UserPolicyArgs;
import com.pulumi.aws.ecr.PullTimeUpdateExclusion;
import com.pulumi.aws.ecr.PullTimeUpdateExclusionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new User("example", UserArgs.builder()
.name("example-user")
.build());
var exampleUserPolicy = new UserPolicy("exampleUserPolicy", UserPolicyArgs.builder()
.name("example-user-policy")
.user(example.name())
.policy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Effect", "Allow"),
jsonProperty("Action", jsonArray(
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage"
)),
jsonProperty("Resource", "*")
)))
)))
.build());
var examplePullTimeUpdateExclusion = new PullTimeUpdateExclusion("examplePullTimeUpdateExclusion", PullTimeUpdateExclusionArgs.builder()
.principalArn(example.arn())
.build());
}
}
resources:
example:
type: aws:iam:User
properties:
name: example-user
exampleUserPolicy:
type: aws:iam:UserPolicy
name: example
properties:
name: example-user-policy
user: ${example.name}
policy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- ecr:GetAuthorizationToken
- ecr:BatchCheckLayerAvailability
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
Resource: '*'
examplePullTimeUpdateExclusion:
type: aws:ecr:PullTimeUpdateExclusion
name: example
properties:
principalArn: ${example.arn}
Import
Using pulumi import, import ECR (Elastic Container Registry) Pull Time Update Exclusion using the principalArn. For example:
$ pulumi import aws:ecr/pullTimeUpdateExclusion:PullTimeUpdateExclusion example arn:aws:iam::123456789012:role/example-role
Constructors
- PullTimeUpdateExclusion(String name, {PullTimeUpdateExclusionArgs? args, CustomResourceOptions? options})
-
Creates a new PullTimeUpdateExclusion.
nameThe Pulumi resource name.argsArguments used to configure this PullTimeUpdateExclusion. The set of arguments for PullTimeUpdateExclusion.optionsResource options controlling this resource's behavior. - PullTimeUpdateExclusion.reference(String urn)
- Creates a typed reference to an existing PullTimeUpdateExclusion resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
principalArn
↔ Output<
String> -
ARN of the IAM principal to exclude from having image pull times recorded.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {PullTimeUpdateExclusionState? state, CustomResourceOptions? options}) → PullTimeUpdateExclusion -
Gets an existing PullTimeUpdateExclusion resource's state with the given
nameandid.