github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/auditmanager/assessmentDelegation.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 auditmanager 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 // Resource for managing an AWS Audit Manager Assessment Delegation. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/auditmanager" 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 := auditmanager.NewAssessmentDelegation(ctx, "example", &auditmanager.AssessmentDelegationArgs{ 35 // AssessmentId: pulumi.Any(exampleAwsAuditmanagerAssessment.Id), 36 // RoleArn: pulumi.Any(exampleAwsIamRole.Arn), 37 // RoleType: pulumi.String("RESOURCE_OWNER"), 38 // ControlSetId: pulumi.String("example"), 39 // }) 40 // if err != nil { 41 // return err 42 // } 43 // return nil 44 // }) 45 // } 46 // 47 // ``` 48 // <!--End PulumiCodeChooser --> 49 // 50 // ## Import 51 // 52 // Using `pulumi import`, import Audit Manager Assessment Delegation using the `id`. For example: 53 // 54 // ```sh 55 // $ pulumi import aws:auditmanager/assessmentDelegation:AssessmentDelegation example abcdef-123456,arn:aws:iam::012345678901:role/example,example 56 // ``` 57 type AssessmentDelegation struct { 58 pulumi.CustomResourceState 59 60 // Identifier for the assessment. 61 AssessmentId pulumi.StringOutput `pulumi:"assessmentId"` 62 // Comment describing the delegation request. 63 Comment pulumi.StringPtrOutput `pulumi:"comment"` 64 // Assessment control set name. This value is the control set name used during assessment creation (not the AWS-generated ID). The `_id` suffix on this attribute has been preserved to be consistent with the underlying AWS API. 65 ControlSetId pulumi.StringOutput `pulumi:"controlSetId"` 66 // Unique identifier for the delegation. 67 DelegationId pulumi.StringOutput `pulumi:"delegationId"` 68 // Amazon Resource Name (ARN) of the IAM role. 69 RoleArn pulumi.StringOutput `pulumi:"roleArn"` 70 // Type of customer persona. For assessment delegation, type must always be `RESOURCE_OWNER`. 71 // 72 // The following arguments are optional: 73 RoleType pulumi.StringOutput `pulumi:"roleType"` 74 // Status of the delegation. 75 Status pulumi.StringOutput `pulumi:"status"` 76 } 77 78 // NewAssessmentDelegation registers a new resource with the given unique name, arguments, and options. 79 func NewAssessmentDelegation(ctx *pulumi.Context, 80 name string, args *AssessmentDelegationArgs, opts ...pulumi.ResourceOption) (*AssessmentDelegation, error) { 81 if args == nil { 82 return nil, errors.New("missing one or more required arguments") 83 } 84 85 if args.AssessmentId == nil { 86 return nil, errors.New("invalid value for required argument 'AssessmentId'") 87 } 88 if args.ControlSetId == nil { 89 return nil, errors.New("invalid value for required argument 'ControlSetId'") 90 } 91 if args.RoleArn == nil { 92 return nil, errors.New("invalid value for required argument 'RoleArn'") 93 } 94 if args.RoleType == nil { 95 return nil, errors.New("invalid value for required argument 'RoleType'") 96 } 97 opts = internal.PkgResourceDefaultOpts(opts) 98 var resource AssessmentDelegation 99 err := ctx.RegisterResource("aws:auditmanager/assessmentDelegation:AssessmentDelegation", name, args, &resource, opts...) 100 if err != nil { 101 return nil, err 102 } 103 return &resource, nil 104 } 105 106 // GetAssessmentDelegation gets an existing AssessmentDelegation resource's state with the given name, ID, and optional 107 // state properties that are used to uniquely qualify the lookup (nil if not required). 108 func GetAssessmentDelegation(ctx *pulumi.Context, 109 name string, id pulumi.IDInput, state *AssessmentDelegationState, opts ...pulumi.ResourceOption) (*AssessmentDelegation, error) { 110 var resource AssessmentDelegation 111 err := ctx.ReadResource("aws:auditmanager/assessmentDelegation:AssessmentDelegation", name, id, state, &resource, opts...) 112 if err != nil { 113 return nil, err 114 } 115 return &resource, nil 116 } 117 118 // Input properties used for looking up and filtering AssessmentDelegation resources. 119 type assessmentDelegationState struct { 120 // Identifier for the assessment. 121 AssessmentId *string `pulumi:"assessmentId"` 122 // Comment describing the delegation request. 123 Comment *string `pulumi:"comment"` 124 // Assessment control set name. This value is the control set name used during assessment creation (not the AWS-generated ID). The `_id` suffix on this attribute has been preserved to be consistent with the underlying AWS API. 125 ControlSetId *string `pulumi:"controlSetId"` 126 // Unique identifier for the delegation. 127 DelegationId *string `pulumi:"delegationId"` 128 // Amazon Resource Name (ARN) of the IAM role. 129 RoleArn *string `pulumi:"roleArn"` 130 // Type of customer persona. For assessment delegation, type must always be `RESOURCE_OWNER`. 131 // 132 // The following arguments are optional: 133 RoleType *string `pulumi:"roleType"` 134 // Status of the delegation. 135 Status *string `pulumi:"status"` 136 } 137 138 type AssessmentDelegationState struct { 139 // Identifier for the assessment. 140 AssessmentId pulumi.StringPtrInput 141 // Comment describing the delegation request. 142 Comment pulumi.StringPtrInput 143 // Assessment control set name. This value is the control set name used during assessment creation (not the AWS-generated ID). The `_id` suffix on this attribute has been preserved to be consistent with the underlying AWS API. 144 ControlSetId pulumi.StringPtrInput 145 // Unique identifier for the delegation. 146 DelegationId pulumi.StringPtrInput 147 // Amazon Resource Name (ARN) of the IAM role. 148 RoleArn pulumi.StringPtrInput 149 // Type of customer persona. For assessment delegation, type must always be `RESOURCE_OWNER`. 150 // 151 // The following arguments are optional: 152 RoleType pulumi.StringPtrInput 153 // Status of the delegation. 154 Status pulumi.StringPtrInput 155 } 156 157 func (AssessmentDelegationState) ElementType() reflect.Type { 158 return reflect.TypeOf((*assessmentDelegationState)(nil)).Elem() 159 } 160 161 type assessmentDelegationArgs struct { 162 // Identifier for the assessment. 163 AssessmentId string `pulumi:"assessmentId"` 164 // Comment describing the delegation request. 165 Comment *string `pulumi:"comment"` 166 // Assessment control set name. This value is the control set name used during assessment creation (not the AWS-generated ID). The `_id` suffix on this attribute has been preserved to be consistent with the underlying AWS API. 167 ControlSetId string `pulumi:"controlSetId"` 168 // Amazon Resource Name (ARN) of the IAM role. 169 RoleArn string `pulumi:"roleArn"` 170 // Type of customer persona. For assessment delegation, type must always be `RESOURCE_OWNER`. 171 // 172 // The following arguments are optional: 173 RoleType string `pulumi:"roleType"` 174 } 175 176 // The set of arguments for constructing a AssessmentDelegation resource. 177 type AssessmentDelegationArgs struct { 178 // Identifier for the assessment. 179 AssessmentId pulumi.StringInput 180 // Comment describing the delegation request. 181 Comment pulumi.StringPtrInput 182 // Assessment control set name. This value is the control set name used during assessment creation (not the AWS-generated ID). The `_id` suffix on this attribute has been preserved to be consistent with the underlying AWS API. 183 ControlSetId pulumi.StringInput 184 // Amazon Resource Name (ARN) of the IAM role. 185 RoleArn pulumi.StringInput 186 // Type of customer persona. For assessment delegation, type must always be `RESOURCE_OWNER`. 187 // 188 // The following arguments are optional: 189 RoleType pulumi.StringInput 190 } 191 192 func (AssessmentDelegationArgs) ElementType() reflect.Type { 193 return reflect.TypeOf((*assessmentDelegationArgs)(nil)).Elem() 194 } 195 196 type AssessmentDelegationInput interface { 197 pulumi.Input 198 199 ToAssessmentDelegationOutput() AssessmentDelegationOutput 200 ToAssessmentDelegationOutputWithContext(ctx context.Context) AssessmentDelegationOutput 201 } 202 203 func (*AssessmentDelegation) ElementType() reflect.Type { 204 return reflect.TypeOf((**AssessmentDelegation)(nil)).Elem() 205 } 206 207 func (i *AssessmentDelegation) ToAssessmentDelegationOutput() AssessmentDelegationOutput { 208 return i.ToAssessmentDelegationOutputWithContext(context.Background()) 209 } 210 211 func (i *AssessmentDelegation) ToAssessmentDelegationOutputWithContext(ctx context.Context) AssessmentDelegationOutput { 212 return pulumi.ToOutputWithContext(ctx, i).(AssessmentDelegationOutput) 213 } 214 215 // AssessmentDelegationArrayInput is an input type that accepts AssessmentDelegationArray and AssessmentDelegationArrayOutput values. 216 // You can construct a concrete instance of `AssessmentDelegationArrayInput` via: 217 // 218 // AssessmentDelegationArray{ AssessmentDelegationArgs{...} } 219 type AssessmentDelegationArrayInput interface { 220 pulumi.Input 221 222 ToAssessmentDelegationArrayOutput() AssessmentDelegationArrayOutput 223 ToAssessmentDelegationArrayOutputWithContext(context.Context) AssessmentDelegationArrayOutput 224 } 225 226 type AssessmentDelegationArray []AssessmentDelegationInput 227 228 func (AssessmentDelegationArray) ElementType() reflect.Type { 229 return reflect.TypeOf((*[]*AssessmentDelegation)(nil)).Elem() 230 } 231 232 func (i AssessmentDelegationArray) ToAssessmentDelegationArrayOutput() AssessmentDelegationArrayOutput { 233 return i.ToAssessmentDelegationArrayOutputWithContext(context.Background()) 234 } 235 236 func (i AssessmentDelegationArray) ToAssessmentDelegationArrayOutputWithContext(ctx context.Context) AssessmentDelegationArrayOutput { 237 return pulumi.ToOutputWithContext(ctx, i).(AssessmentDelegationArrayOutput) 238 } 239 240 // AssessmentDelegationMapInput is an input type that accepts AssessmentDelegationMap and AssessmentDelegationMapOutput values. 241 // You can construct a concrete instance of `AssessmentDelegationMapInput` via: 242 // 243 // AssessmentDelegationMap{ "key": AssessmentDelegationArgs{...} } 244 type AssessmentDelegationMapInput interface { 245 pulumi.Input 246 247 ToAssessmentDelegationMapOutput() AssessmentDelegationMapOutput 248 ToAssessmentDelegationMapOutputWithContext(context.Context) AssessmentDelegationMapOutput 249 } 250 251 type AssessmentDelegationMap map[string]AssessmentDelegationInput 252 253 func (AssessmentDelegationMap) ElementType() reflect.Type { 254 return reflect.TypeOf((*map[string]*AssessmentDelegation)(nil)).Elem() 255 } 256 257 func (i AssessmentDelegationMap) ToAssessmentDelegationMapOutput() AssessmentDelegationMapOutput { 258 return i.ToAssessmentDelegationMapOutputWithContext(context.Background()) 259 } 260 261 func (i AssessmentDelegationMap) ToAssessmentDelegationMapOutputWithContext(ctx context.Context) AssessmentDelegationMapOutput { 262 return pulumi.ToOutputWithContext(ctx, i).(AssessmentDelegationMapOutput) 263 } 264 265 type AssessmentDelegationOutput struct{ *pulumi.OutputState } 266 267 func (AssessmentDelegationOutput) ElementType() reflect.Type { 268 return reflect.TypeOf((**AssessmentDelegation)(nil)).Elem() 269 } 270 271 func (o AssessmentDelegationOutput) ToAssessmentDelegationOutput() AssessmentDelegationOutput { 272 return o 273 } 274 275 func (o AssessmentDelegationOutput) ToAssessmentDelegationOutputWithContext(ctx context.Context) AssessmentDelegationOutput { 276 return o 277 } 278 279 // Identifier for the assessment. 280 func (o AssessmentDelegationOutput) AssessmentId() pulumi.StringOutput { 281 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringOutput { return v.AssessmentId }).(pulumi.StringOutput) 282 } 283 284 // Comment describing the delegation request. 285 func (o AssessmentDelegationOutput) Comment() pulumi.StringPtrOutput { 286 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput) 287 } 288 289 // Assessment control set name. This value is the control set name used during assessment creation (not the AWS-generated ID). The `_id` suffix on this attribute has been preserved to be consistent with the underlying AWS API. 290 func (o AssessmentDelegationOutput) ControlSetId() pulumi.StringOutput { 291 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringOutput { return v.ControlSetId }).(pulumi.StringOutput) 292 } 293 294 // Unique identifier for the delegation. 295 func (o AssessmentDelegationOutput) DelegationId() pulumi.StringOutput { 296 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringOutput { return v.DelegationId }).(pulumi.StringOutput) 297 } 298 299 // Amazon Resource Name (ARN) of the IAM role. 300 func (o AssessmentDelegationOutput) RoleArn() pulumi.StringOutput { 301 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput) 302 } 303 304 // Type of customer persona. For assessment delegation, type must always be `RESOURCE_OWNER`. 305 // 306 // The following arguments are optional: 307 func (o AssessmentDelegationOutput) RoleType() pulumi.StringOutput { 308 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringOutput { return v.RoleType }).(pulumi.StringOutput) 309 } 310 311 // Status of the delegation. 312 func (o AssessmentDelegationOutput) Status() pulumi.StringOutput { 313 return o.ApplyT(func(v *AssessmentDelegation) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 314 } 315 316 type AssessmentDelegationArrayOutput struct{ *pulumi.OutputState } 317 318 func (AssessmentDelegationArrayOutput) ElementType() reflect.Type { 319 return reflect.TypeOf((*[]*AssessmentDelegation)(nil)).Elem() 320 } 321 322 func (o AssessmentDelegationArrayOutput) ToAssessmentDelegationArrayOutput() AssessmentDelegationArrayOutput { 323 return o 324 } 325 326 func (o AssessmentDelegationArrayOutput) ToAssessmentDelegationArrayOutputWithContext(ctx context.Context) AssessmentDelegationArrayOutput { 327 return o 328 } 329 330 func (o AssessmentDelegationArrayOutput) Index(i pulumi.IntInput) AssessmentDelegationOutput { 331 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AssessmentDelegation { 332 return vs[0].([]*AssessmentDelegation)[vs[1].(int)] 333 }).(AssessmentDelegationOutput) 334 } 335 336 type AssessmentDelegationMapOutput struct{ *pulumi.OutputState } 337 338 func (AssessmentDelegationMapOutput) ElementType() reflect.Type { 339 return reflect.TypeOf((*map[string]*AssessmentDelegation)(nil)).Elem() 340 } 341 342 func (o AssessmentDelegationMapOutput) ToAssessmentDelegationMapOutput() AssessmentDelegationMapOutput { 343 return o 344 } 345 346 func (o AssessmentDelegationMapOutput) ToAssessmentDelegationMapOutputWithContext(ctx context.Context) AssessmentDelegationMapOutput { 347 return o 348 } 349 350 func (o AssessmentDelegationMapOutput) MapIndex(k pulumi.StringInput) AssessmentDelegationOutput { 351 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AssessmentDelegation { 352 return vs[0].(map[string]*AssessmentDelegation)[vs[1].(string)] 353 }).(AssessmentDelegationOutput) 354 } 355 356 func init() { 357 pulumi.RegisterInputType(reflect.TypeOf((*AssessmentDelegationInput)(nil)).Elem(), &AssessmentDelegation{}) 358 pulumi.RegisterInputType(reflect.TypeOf((*AssessmentDelegationArrayInput)(nil)).Elem(), AssessmentDelegationArray{}) 359 pulumi.RegisterInputType(reflect.TypeOf((*AssessmentDelegationMapInput)(nil)).Elem(), AssessmentDelegationMap{}) 360 pulumi.RegisterOutputType(AssessmentDelegationOutput{}) 361 pulumi.RegisterOutputType(AssessmentDelegationArrayOutput{}) 362 pulumi.RegisterOutputType(AssessmentDelegationMapOutput{}) 363 }