KeyGroup class
Example Usage
The following example below creates a CloudFront key group.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";
const example = new aws.cloudfront.PublicKey("example", {
comment: "example public key",
encodedKey: std.file({
input: "public_key.pem",
}).then(invoke => invoke.result),
name: "example-key",
});
const exampleKeyGroup = new aws.cloudfront.KeyGroup("example", {
comment: "example key group",
items: [example.id],
name: "example-key-group",
});
import pulumi
import pulumi_aws as aws
import pulumi_std as std
example = aws.cloudfront.PublicKey("example",
comment="example public key",
encoded_key=std.file(input="public_key.pem").result,
name="example-key")
example_key_group = aws.cloudfront.KeyGroup("example",
comment="example key group",
items=[example.id],
name="example-key-group")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Aws.CloudFront.PublicKey("example", new()
{
Comment = "example public key",
EncodedKey = Std.File.Invoke(new()
{
Input = "public_key.pem",
}).Apply(invoke => invoke.Result),
Name = "example-key",
});
var exampleKeyGroup = new Aws.CloudFront.KeyGroup("example", new()
{
Comment = "example key group",
Items = new[]
{
example.Id,
},
Name = "example-key-group",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "public_key.pem",
}, nil)
if err != nil {
return err
}
example, err := cloudfront.NewPublicKey(ctx, "example", &cloudfront.PublicKeyArgs{
Comment: pulumi.String("example public key"),
EncodedKey: pulumi.String(invokeFile.Result),
Name: pulumi.String("example-key"),
})
if err != nil {
return err
}
_, err = cloudfront.NewKeyGroup(ctx, "example", &cloudfront.KeyGroupArgs{
Comment: pulumi.String("example key group"),
Items: pulumi.StringArray{
example.ID().ToIDOutput().ToStringOutput(),
},
Name: pulumi.String("example-key-group"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
std = {
source = "pulumi/std"
}
}
}
resource "aws_cloudfront_publickey" "example" {
comment = "example public key"
encoded_key = file("public_key.pem")
name = "example-key"
}
resource "aws_cloudfront_keygroup" "example" {
comment = "example key group"
items = [aws_cloudfront_publickey.example.id]
name = "example-key-group"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.PublicKey;
import com.pulumi.aws.cloudfront.PublicKeyArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FileArgs;
import com.pulumi.aws.cloudfront.KeyGroup;
import com.pulumi.aws.cloudfront.KeyGroupArgs;
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 PublicKey("example", PublicKeyArgs.builder()
.comment("example public key")
.encodedKey(StdFunctions.file(FileArgs.builder()
.input("public_key.pem")
.build()).result())
.name("example-key")
.build());
var exampleKeyGroup = new KeyGroup("exampleKeyGroup", KeyGroupArgs.builder()
.comment("example key group")
.items(example.id())
.name("example-key-group")
.build());
}
}
resources:
example:
type: aws:cloudfront:PublicKey
properties:
comment: example public key
encodedKey:
fn::invoke:
function: std:file
arguments:
input: public_key.pem
return: result
name: example-key
exampleKeyGroup:
type: aws:cloudfront:KeyGroup
name: example
properties:
comment: example key group
items:
- ${example.id}
name: example-key-group
Import
Using pulumi import, import CloudFront Key Group using the id. For example:
$ pulumi import aws:cloudfront/keyGroup:KeyGroup example 4b4f2r1c-315d-5c2e-f093-216t50jed10f
Constructors
- KeyGroup(String name, {KeyGroupArgs? args, CustomResourceOptions? options})
-
Creates a new KeyGroup.
nameThe Pulumi resource name.argsArguments used to configure this KeyGroup. The set of arguments for KeyGroup.optionsResource options controlling this resource's behavior. - KeyGroup.reference(String urn)
- Creates a typed reference to an existing KeyGroup resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
comment
↔ Output<
String?> -
A comment to describe the key group..
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
etag
↔ Output<
String> -
The identifier for this version of the key group.
latefinal
- 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
-
items
↔ Output<
List< String> > -
A list of the identifiers of the public keys in the key group.
latefinal
-
name
↔ Output<
String> -
A name to identify the key group.
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