-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcustom.go
More file actions
52 lines (47 loc) · 1.79 KB
/
Copy pathcustom.go
File metadata and controls
52 lines (47 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2024, Pulumi Corporation.
package resources
import (
"context"
"time"
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
"github.com/pulumi/pulumi-aws-native/provider/pkg/autonaming"
)
//go:generate mockgen -package resources -source custom.go -destination mock_custom_resource.go CustomResource
type CustomResource interface {
// Check validates and transforms the inputs of the resource.
Check(ctx context.Context, urn resource.URN, engineAutonaming autonaming.EngineAutoNamingConfig,
inputs, state resource.PropertyMap, defaultTags map[string]string) (resource.PropertyMap, []ValidationFailure, error)
// Create creates a new resource in the cloud provider and returns its unique identifier and outputs.
Create(
ctx context.Context,
urn resource.URN,
inputs resource.PropertyMap,
timeout time.Duration,
) (identifier *string, outputs resource.PropertyMap, err error)
// Read returns the outputs and the updated inputs of the resource.
Read(
ctx context.Context,
urn resource.URN,
id string,
oldInputs, oldOutputs resource.PropertyMap,
) (outputs resource.PropertyMap, inputs resource.PropertyMap, exists bool, err error)
// Update applies the diff of the inputs to the resource and returns the updated outputs.
Update(
ctx context.Context,
urn resource.URN,
id string,
inputs, oldInputs, state resource.PropertyMap,
timeout time.Duration,
) (resource.PropertyMap, error)
// Delete removes the resource from the cloud provider.
Delete(
ctx context.Context,
urn resource.URN,
id string,
inputs, state resource.PropertyMap,
timeout time.Duration,
) error
// PreviewCustomResourceOutputs returns the outputs of the resource based on the inputs and the output properties in
// the resource schema.
PreviewCustomResourceOutputs() resource.PropertyMap
}