github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lambda/codeSigningConfig.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package lambda 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a Lambda Code Signing Config resource. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail). 16 // 17 // For information about Lambda code signing configurations and how to use them, see [configuring code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) 18 // 19 // ## Example Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := lambda.NewCodeSigningConfig(ctx, "new_csc", &lambda.CodeSigningConfigArgs{ 35 // AllowedPublishers: &lambda.CodeSigningConfigAllowedPublishersArgs{ 36 // SigningProfileVersionArns: pulumi.StringArray{ 37 // example1.Arn, 38 // example2.Arn, 39 // }, 40 // }, 41 // Policies: &lambda.CodeSigningConfigPoliciesArgs{ 42 // UntrustedArtifactOnDeployment: pulumi.String("Warn"), 43 // }, 44 // Description: pulumi.String("My awesome code signing config."), 45 // }) 46 // if err != nil { 47 // return err 48 // } 49 // return nil 50 // }) 51 // } 52 // 53 // ``` 54 // <!--End PulumiCodeChooser --> 55 // 56 // ## Import 57 // 58 // Using `pulumi import`, import Code Signing Configs using their ARN. For example: 59 // 60 // ```sh 61 // $ pulumi import aws:lambda/codeSigningConfig:CodeSigningConfig imported_csc arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0f6c334abcdea4d8b 62 // ``` 63 type CodeSigningConfig struct { 64 pulumi.CustomResourceState 65 66 // A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. 67 AllowedPublishers CodeSigningConfigAllowedPublishersOutput `pulumi:"allowedPublishers"` 68 // The Amazon Resource Name (ARN) of the code signing configuration. 69 Arn pulumi.StringOutput `pulumi:"arn"` 70 // Unique identifier for the code signing configuration. 71 ConfigId pulumi.StringOutput `pulumi:"configId"` 72 // Descriptive name for this code signing configuration. 73 Description pulumi.StringPtrOutput `pulumi:"description"` 74 // The date and time that the code signing configuration was last modified. 75 LastModified pulumi.StringOutput `pulumi:"lastModified"` 76 // A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. 77 Policies CodeSigningConfigPoliciesOutput `pulumi:"policies"` 78 } 79 80 // NewCodeSigningConfig registers a new resource with the given unique name, arguments, and options. 81 func NewCodeSigningConfig(ctx *pulumi.Context, 82 name string, args *CodeSigningConfigArgs, opts ...pulumi.ResourceOption) (*CodeSigningConfig, error) { 83 if args == nil { 84 return nil, errors.New("missing one or more required arguments") 85 } 86 87 if args.AllowedPublishers == nil { 88 return nil, errors.New("invalid value for required argument 'AllowedPublishers'") 89 } 90 opts = internal.PkgResourceDefaultOpts(opts) 91 var resource CodeSigningConfig 92 err := ctx.RegisterResource("aws:lambda/codeSigningConfig:CodeSigningConfig", name, args, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // GetCodeSigningConfig gets an existing CodeSigningConfig resource's state with the given name, ID, and optional 100 // state properties that are used to uniquely qualify the lookup (nil if not required). 101 func GetCodeSigningConfig(ctx *pulumi.Context, 102 name string, id pulumi.IDInput, state *CodeSigningConfigState, opts ...pulumi.ResourceOption) (*CodeSigningConfig, error) { 103 var resource CodeSigningConfig 104 err := ctx.ReadResource("aws:lambda/codeSigningConfig:CodeSigningConfig", name, id, state, &resource, opts...) 105 if err != nil { 106 return nil, err 107 } 108 return &resource, nil 109 } 110 111 // Input properties used for looking up and filtering CodeSigningConfig resources. 112 type codeSigningConfigState struct { 113 // A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. 114 AllowedPublishers *CodeSigningConfigAllowedPublishers `pulumi:"allowedPublishers"` 115 // The Amazon Resource Name (ARN) of the code signing configuration. 116 Arn *string `pulumi:"arn"` 117 // Unique identifier for the code signing configuration. 118 ConfigId *string `pulumi:"configId"` 119 // Descriptive name for this code signing configuration. 120 Description *string `pulumi:"description"` 121 // The date and time that the code signing configuration was last modified. 122 LastModified *string `pulumi:"lastModified"` 123 // A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. 124 Policies *CodeSigningConfigPolicies `pulumi:"policies"` 125 } 126 127 type CodeSigningConfigState struct { 128 // A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. 129 AllowedPublishers CodeSigningConfigAllowedPublishersPtrInput 130 // The Amazon Resource Name (ARN) of the code signing configuration. 131 Arn pulumi.StringPtrInput 132 // Unique identifier for the code signing configuration. 133 ConfigId pulumi.StringPtrInput 134 // Descriptive name for this code signing configuration. 135 Description pulumi.StringPtrInput 136 // The date and time that the code signing configuration was last modified. 137 LastModified pulumi.StringPtrInput 138 // A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. 139 Policies CodeSigningConfigPoliciesPtrInput 140 } 141 142 func (CodeSigningConfigState) ElementType() reflect.Type { 143 return reflect.TypeOf((*codeSigningConfigState)(nil)).Elem() 144 } 145 146 type codeSigningConfigArgs struct { 147 // A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. 148 AllowedPublishers CodeSigningConfigAllowedPublishers `pulumi:"allowedPublishers"` 149 // Descriptive name for this code signing configuration. 150 Description *string `pulumi:"description"` 151 // A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. 152 Policies *CodeSigningConfigPolicies `pulumi:"policies"` 153 } 154 155 // The set of arguments for constructing a CodeSigningConfig resource. 156 type CodeSigningConfigArgs struct { 157 // A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. 158 AllowedPublishers CodeSigningConfigAllowedPublishersInput 159 // Descriptive name for this code signing configuration. 160 Description pulumi.StringPtrInput 161 // A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. 162 Policies CodeSigningConfigPoliciesPtrInput 163 } 164 165 func (CodeSigningConfigArgs) ElementType() reflect.Type { 166 return reflect.TypeOf((*codeSigningConfigArgs)(nil)).Elem() 167 } 168 169 type CodeSigningConfigInput interface { 170 pulumi.Input 171 172 ToCodeSigningConfigOutput() CodeSigningConfigOutput 173 ToCodeSigningConfigOutputWithContext(ctx context.Context) CodeSigningConfigOutput 174 } 175 176 func (*CodeSigningConfig) ElementType() reflect.Type { 177 return reflect.TypeOf((**CodeSigningConfig)(nil)).Elem() 178 } 179 180 func (i *CodeSigningConfig) ToCodeSigningConfigOutput() CodeSigningConfigOutput { 181 return i.ToCodeSigningConfigOutputWithContext(context.Background()) 182 } 183 184 func (i *CodeSigningConfig) ToCodeSigningConfigOutputWithContext(ctx context.Context) CodeSigningConfigOutput { 185 return pulumi.ToOutputWithContext(ctx, i).(CodeSigningConfigOutput) 186 } 187 188 // CodeSigningConfigArrayInput is an input type that accepts CodeSigningConfigArray and CodeSigningConfigArrayOutput values. 189 // You can construct a concrete instance of `CodeSigningConfigArrayInput` via: 190 // 191 // CodeSigningConfigArray{ CodeSigningConfigArgs{...} } 192 type CodeSigningConfigArrayInput interface { 193 pulumi.Input 194 195 ToCodeSigningConfigArrayOutput() CodeSigningConfigArrayOutput 196 ToCodeSigningConfigArrayOutputWithContext(context.Context) CodeSigningConfigArrayOutput 197 } 198 199 type CodeSigningConfigArray []CodeSigningConfigInput 200 201 func (CodeSigningConfigArray) ElementType() reflect.Type { 202 return reflect.TypeOf((*[]*CodeSigningConfig)(nil)).Elem() 203 } 204 205 func (i CodeSigningConfigArray) ToCodeSigningConfigArrayOutput() CodeSigningConfigArrayOutput { 206 return i.ToCodeSigningConfigArrayOutputWithContext(context.Background()) 207 } 208 209 func (i CodeSigningConfigArray) ToCodeSigningConfigArrayOutputWithContext(ctx context.Context) CodeSigningConfigArrayOutput { 210 return pulumi.ToOutputWithContext(ctx, i).(CodeSigningConfigArrayOutput) 211 } 212 213 // CodeSigningConfigMapInput is an input type that accepts CodeSigningConfigMap and CodeSigningConfigMapOutput values. 214 // You can construct a concrete instance of `CodeSigningConfigMapInput` via: 215 // 216 // CodeSigningConfigMap{ "key": CodeSigningConfigArgs{...} } 217 type CodeSigningConfigMapInput interface { 218 pulumi.Input 219 220 ToCodeSigningConfigMapOutput() CodeSigningConfigMapOutput 221 ToCodeSigningConfigMapOutputWithContext(context.Context) CodeSigningConfigMapOutput 222 } 223 224 type CodeSigningConfigMap map[string]CodeSigningConfigInput 225 226 func (CodeSigningConfigMap) ElementType() reflect.Type { 227 return reflect.TypeOf((*map[string]*CodeSigningConfig)(nil)).Elem() 228 } 229 230 func (i CodeSigningConfigMap) ToCodeSigningConfigMapOutput() CodeSigningConfigMapOutput { 231 return i.ToCodeSigningConfigMapOutputWithContext(context.Background()) 232 } 233 234 func (i CodeSigningConfigMap) ToCodeSigningConfigMapOutputWithContext(ctx context.Context) CodeSigningConfigMapOutput { 235 return pulumi.ToOutputWithContext(ctx, i).(CodeSigningConfigMapOutput) 236 } 237 238 type CodeSigningConfigOutput struct{ *pulumi.OutputState } 239 240 func (CodeSigningConfigOutput) ElementType() reflect.Type { 241 return reflect.TypeOf((**CodeSigningConfig)(nil)).Elem() 242 } 243 244 func (o CodeSigningConfigOutput) ToCodeSigningConfigOutput() CodeSigningConfigOutput { 245 return o 246 } 247 248 func (o CodeSigningConfigOutput) ToCodeSigningConfigOutputWithContext(ctx context.Context) CodeSigningConfigOutput { 249 return o 250 } 251 252 // A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. 253 func (o CodeSigningConfigOutput) AllowedPublishers() CodeSigningConfigAllowedPublishersOutput { 254 return o.ApplyT(func(v *CodeSigningConfig) CodeSigningConfigAllowedPublishersOutput { return v.AllowedPublishers }).(CodeSigningConfigAllowedPublishersOutput) 255 } 256 257 // The Amazon Resource Name (ARN) of the code signing configuration. 258 func (o CodeSigningConfigOutput) Arn() pulumi.StringOutput { 259 return o.ApplyT(func(v *CodeSigningConfig) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 260 } 261 262 // Unique identifier for the code signing configuration. 263 func (o CodeSigningConfigOutput) ConfigId() pulumi.StringOutput { 264 return o.ApplyT(func(v *CodeSigningConfig) pulumi.StringOutput { return v.ConfigId }).(pulumi.StringOutput) 265 } 266 267 // Descriptive name for this code signing configuration. 268 func (o CodeSigningConfigOutput) Description() pulumi.StringPtrOutput { 269 return o.ApplyT(func(v *CodeSigningConfig) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 270 } 271 272 // The date and time that the code signing configuration was last modified. 273 func (o CodeSigningConfigOutput) LastModified() pulumi.StringOutput { 274 return o.ApplyT(func(v *CodeSigningConfig) pulumi.StringOutput { return v.LastModified }).(pulumi.StringOutput) 275 } 276 277 // A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. 278 func (o CodeSigningConfigOutput) Policies() CodeSigningConfigPoliciesOutput { 279 return o.ApplyT(func(v *CodeSigningConfig) CodeSigningConfigPoliciesOutput { return v.Policies }).(CodeSigningConfigPoliciesOutput) 280 } 281 282 type CodeSigningConfigArrayOutput struct{ *pulumi.OutputState } 283 284 func (CodeSigningConfigArrayOutput) ElementType() reflect.Type { 285 return reflect.TypeOf((*[]*CodeSigningConfig)(nil)).Elem() 286 } 287 288 func (o CodeSigningConfigArrayOutput) ToCodeSigningConfigArrayOutput() CodeSigningConfigArrayOutput { 289 return o 290 } 291 292 func (o CodeSigningConfigArrayOutput) ToCodeSigningConfigArrayOutputWithContext(ctx context.Context) CodeSigningConfigArrayOutput { 293 return o 294 } 295 296 func (o CodeSigningConfigArrayOutput) Index(i pulumi.IntInput) CodeSigningConfigOutput { 297 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CodeSigningConfig { 298 return vs[0].([]*CodeSigningConfig)[vs[1].(int)] 299 }).(CodeSigningConfigOutput) 300 } 301 302 type CodeSigningConfigMapOutput struct{ *pulumi.OutputState } 303 304 func (CodeSigningConfigMapOutput) ElementType() reflect.Type { 305 return reflect.TypeOf((*map[string]*CodeSigningConfig)(nil)).Elem() 306 } 307 308 func (o CodeSigningConfigMapOutput) ToCodeSigningConfigMapOutput() CodeSigningConfigMapOutput { 309 return o 310 } 311 312 func (o CodeSigningConfigMapOutput) ToCodeSigningConfigMapOutputWithContext(ctx context.Context) CodeSigningConfigMapOutput { 313 return o 314 } 315 316 func (o CodeSigningConfigMapOutput) MapIndex(k pulumi.StringInput) CodeSigningConfigOutput { 317 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CodeSigningConfig { 318 return vs[0].(map[string]*CodeSigningConfig)[vs[1].(string)] 319 }).(CodeSigningConfigOutput) 320 } 321 322 func init() { 323 pulumi.RegisterInputType(reflect.TypeOf((*CodeSigningConfigInput)(nil)).Elem(), &CodeSigningConfig{}) 324 pulumi.RegisterInputType(reflect.TypeOf((*CodeSigningConfigArrayInput)(nil)).Elem(), CodeSigningConfigArray{}) 325 pulumi.RegisterInputType(reflect.TypeOf((*CodeSigningConfigMapInput)(nil)).Elem(), CodeSigningConfigMap{}) 326 pulumi.RegisterOutputType(CodeSigningConfigOutput{}) 327 pulumi.RegisterOutputType(CodeSigningConfigArrayOutput{}) 328 pulumi.RegisterOutputType(CodeSigningConfigMapOutput{}) 329 }