github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cognito/identityPoolRoleAttachment.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 cognito 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 an AWS Cognito Identity Pool Roles Attachment. 16 // 17 // ## Import 18 // 19 // Using `pulumi import`, import Cognito Identity Pool Roles Attachment using the Identity Pool ID. For example: 20 // 21 // ```sh 22 // $ pulumi import aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment example us-west-2:b64805ad-cb56-40ba-9ffc-f5d8207e6d42 23 // ``` 24 type IdentityPoolRoleAttachment struct { 25 pulumi.CustomResourceState 26 27 // An identity pool ID in the format `REGION_GUID`. 28 IdentityPoolId pulumi.StringOutput `pulumi:"identityPoolId"` 29 // A List of Role Mapping. 30 RoleMappings IdentityPoolRoleAttachmentRoleMappingArrayOutput `pulumi:"roleMappings"` 31 // The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN. 32 Roles pulumi.StringMapOutput `pulumi:"roles"` 33 } 34 35 // NewIdentityPoolRoleAttachment registers a new resource with the given unique name, arguments, and options. 36 func NewIdentityPoolRoleAttachment(ctx *pulumi.Context, 37 name string, args *IdentityPoolRoleAttachmentArgs, opts ...pulumi.ResourceOption) (*IdentityPoolRoleAttachment, error) { 38 if args == nil { 39 return nil, errors.New("missing one or more required arguments") 40 } 41 42 if args.IdentityPoolId == nil { 43 return nil, errors.New("invalid value for required argument 'IdentityPoolId'") 44 } 45 if args.Roles == nil { 46 return nil, errors.New("invalid value for required argument 'Roles'") 47 } 48 opts = internal.PkgResourceDefaultOpts(opts) 49 var resource IdentityPoolRoleAttachment 50 err := ctx.RegisterResource("aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment", name, args, &resource, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &resource, nil 55 } 56 57 // GetIdentityPoolRoleAttachment gets an existing IdentityPoolRoleAttachment resource's state with the given name, ID, and optional 58 // state properties that are used to uniquely qualify the lookup (nil if not required). 59 func GetIdentityPoolRoleAttachment(ctx *pulumi.Context, 60 name string, id pulumi.IDInput, state *IdentityPoolRoleAttachmentState, opts ...pulumi.ResourceOption) (*IdentityPoolRoleAttachment, error) { 61 var resource IdentityPoolRoleAttachment 62 err := ctx.ReadResource("aws:cognito/identityPoolRoleAttachment:IdentityPoolRoleAttachment", name, id, state, &resource, opts...) 63 if err != nil { 64 return nil, err 65 } 66 return &resource, nil 67 } 68 69 // Input properties used for looking up and filtering IdentityPoolRoleAttachment resources. 70 type identityPoolRoleAttachmentState struct { 71 // An identity pool ID in the format `REGION_GUID`. 72 IdentityPoolId *string `pulumi:"identityPoolId"` 73 // A List of Role Mapping. 74 RoleMappings []IdentityPoolRoleAttachmentRoleMapping `pulumi:"roleMappings"` 75 // The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN. 76 Roles map[string]string `pulumi:"roles"` 77 } 78 79 type IdentityPoolRoleAttachmentState struct { 80 // An identity pool ID in the format `REGION_GUID`. 81 IdentityPoolId pulumi.StringPtrInput 82 // A List of Role Mapping. 83 RoleMappings IdentityPoolRoleAttachmentRoleMappingArrayInput 84 // The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN. 85 Roles pulumi.StringMapInput 86 } 87 88 func (IdentityPoolRoleAttachmentState) ElementType() reflect.Type { 89 return reflect.TypeOf((*identityPoolRoleAttachmentState)(nil)).Elem() 90 } 91 92 type identityPoolRoleAttachmentArgs struct { 93 // An identity pool ID in the format `REGION_GUID`. 94 IdentityPoolId string `pulumi:"identityPoolId"` 95 // A List of Role Mapping. 96 RoleMappings []IdentityPoolRoleAttachmentRoleMapping `pulumi:"roleMappings"` 97 // The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN. 98 Roles map[string]string `pulumi:"roles"` 99 } 100 101 // The set of arguments for constructing a IdentityPoolRoleAttachment resource. 102 type IdentityPoolRoleAttachmentArgs struct { 103 // An identity pool ID in the format `REGION_GUID`. 104 IdentityPoolId pulumi.StringInput 105 // A List of Role Mapping. 106 RoleMappings IdentityPoolRoleAttachmentRoleMappingArrayInput 107 // The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN. 108 Roles pulumi.StringMapInput 109 } 110 111 func (IdentityPoolRoleAttachmentArgs) ElementType() reflect.Type { 112 return reflect.TypeOf((*identityPoolRoleAttachmentArgs)(nil)).Elem() 113 } 114 115 type IdentityPoolRoleAttachmentInput interface { 116 pulumi.Input 117 118 ToIdentityPoolRoleAttachmentOutput() IdentityPoolRoleAttachmentOutput 119 ToIdentityPoolRoleAttachmentOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentOutput 120 } 121 122 func (*IdentityPoolRoleAttachment) ElementType() reflect.Type { 123 return reflect.TypeOf((**IdentityPoolRoleAttachment)(nil)).Elem() 124 } 125 126 func (i *IdentityPoolRoleAttachment) ToIdentityPoolRoleAttachmentOutput() IdentityPoolRoleAttachmentOutput { 127 return i.ToIdentityPoolRoleAttachmentOutputWithContext(context.Background()) 128 } 129 130 func (i *IdentityPoolRoleAttachment) ToIdentityPoolRoleAttachmentOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentOutput { 131 return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolRoleAttachmentOutput) 132 } 133 134 // IdentityPoolRoleAttachmentArrayInput is an input type that accepts IdentityPoolRoleAttachmentArray and IdentityPoolRoleAttachmentArrayOutput values. 135 // You can construct a concrete instance of `IdentityPoolRoleAttachmentArrayInput` via: 136 // 137 // IdentityPoolRoleAttachmentArray{ IdentityPoolRoleAttachmentArgs{...} } 138 type IdentityPoolRoleAttachmentArrayInput interface { 139 pulumi.Input 140 141 ToIdentityPoolRoleAttachmentArrayOutput() IdentityPoolRoleAttachmentArrayOutput 142 ToIdentityPoolRoleAttachmentArrayOutputWithContext(context.Context) IdentityPoolRoleAttachmentArrayOutput 143 } 144 145 type IdentityPoolRoleAttachmentArray []IdentityPoolRoleAttachmentInput 146 147 func (IdentityPoolRoleAttachmentArray) ElementType() reflect.Type { 148 return reflect.TypeOf((*[]*IdentityPoolRoleAttachment)(nil)).Elem() 149 } 150 151 func (i IdentityPoolRoleAttachmentArray) ToIdentityPoolRoleAttachmentArrayOutput() IdentityPoolRoleAttachmentArrayOutput { 152 return i.ToIdentityPoolRoleAttachmentArrayOutputWithContext(context.Background()) 153 } 154 155 func (i IdentityPoolRoleAttachmentArray) ToIdentityPoolRoleAttachmentArrayOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentArrayOutput { 156 return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolRoleAttachmentArrayOutput) 157 } 158 159 // IdentityPoolRoleAttachmentMapInput is an input type that accepts IdentityPoolRoleAttachmentMap and IdentityPoolRoleAttachmentMapOutput values. 160 // You can construct a concrete instance of `IdentityPoolRoleAttachmentMapInput` via: 161 // 162 // IdentityPoolRoleAttachmentMap{ "key": IdentityPoolRoleAttachmentArgs{...} } 163 type IdentityPoolRoleAttachmentMapInput interface { 164 pulumi.Input 165 166 ToIdentityPoolRoleAttachmentMapOutput() IdentityPoolRoleAttachmentMapOutput 167 ToIdentityPoolRoleAttachmentMapOutputWithContext(context.Context) IdentityPoolRoleAttachmentMapOutput 168 } 169 170 type IdentityPoolRoleAttachmentMap map[string]IdentityPoolRoleAttachmentInput 171 172 func (IdentityPoolRoleAttachmentMap) ElementType() reflect.Type { 173 return reflect.TypeOf((*map[string]*IdentityPoolRoleAttachment)(nil)).Elem() 174 } 175 176 func (i IdentityPoolRoleAttachmentMap) ToIdentityPoolRoleAttachmentMapOutput() IdentityPoolRoleAttachmentMapOutput { 177 return i.ToIdentityPoolRoleAttachmentMapOutputWithContext(context.Background()) 178 } 179 180 func (i IdentityPoolRoleAttachmentMap) ToIdentityPoolRoleAttachmentMapOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentMapOutput { 181 return pulumi.ToOutputWithContext(ctx, i).(IdentityPoolRoleAttachmentMapOutput) 182 } 183 184 type IdentityPoolRoleAttachmentOutput struct{ *pulumi.OutputState } 185 186 func (IdentityPoolRoleAttachmentOutput) ElementType() reflect.Type { 187 return reflect.TypeOf((**IdentityPoolRoleAttachment)(nil)).Elem() 188 } 189 190 func (o IdentityPoolRoleAttachmentOutput) ToIdentityPoolRoleAttachmentOutput() IdentityPoolRoleAttachmentOutput { 191 return o 192 } 193 194 func (o IdentityPoolRoleAttachmentOutput) ToIdentityPoolRoleAttachmentOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentOutput { 195 return o 196 } 197 198 // An identity pool ID in the format `REGION_GUID`. 199 func (o IdentityPoolRoleAttachmentOutput) IdentityPoolId() pulumi.StringOutput { 200 return o.ApplyT(func(v *IdentityPoolRoleAttachment) pulumi.StringOutput { return v.IdentityPoolId }).(pulumi.StringOutput) 201 } 202 203 // A List of Role Mapping. 204 func (o IdentityPoolRoleAttachmentOutput) RoleMappings() IdentityPoolRoleAttachmentRoleMappingArrayOutput { 205 return o.ApplyT(func(v *IdentityPoolRoleAttachment) IdentityPoolRoleAttachmentRoleMappingArrayOutput { 206 return v.RoleMappings 207 }).(IdentityPoolRoleAttachmentRoleMappingArrayOutput) 208 } 209 210 // The map of roles associated with this pool. For a given role, the key will be either "authenticated" or "unauthenticated" and the value will be the Role ARN. 211 func (o IdentityPoolRoleAttachmentOutput) Roles() pulumi.StringMapOutput { 212 return o.ApplyT(func(v *IdentityPoolRoleAttachment) pulumi.StringMapOutput { return v.Roles }).(pulumi.StringMapOutput) 213 } 214 215 type IdentityPoolRoleAttachmentArrayOutput struct{ *pulumi.OutputState } 216 217 func (IdentityPoolRoleAttachmentArrayOutput) ElementType() reflect.Type { 218 return reflect.TypeOf((*[]*IdentityPoolRoleAttachment)(nil)).Elem() 219 } 220 221 func (o IdentityPoolRoleAttachmentArrayOutput) ToIdentityPoolRoleAttachmentArrayOutput() IdentityPoolRoleAttachmentArrayOutput { 222 return o 223 } 224 225 func (o IdentityPoolRoleAttachmentArrayOutput) ToIdentityPoolRoleAttachmentArrayOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentArrayOutput { 226 return o 227 } 228 229 func (o IdentityPoolRoleAttachmentArrayOutput) Index(i pulumi.IntInput) IdentityPoolRoleAttachmentOutput { 230 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IdentityPoolRoleAttachment { 231 return vs[0].([]*IdentityPoolRoleAttachment)[vs[1].(int)] 232 }).(IdentityPoolRoleAttachmentOutput) 233 } 234 235 type IdentityPoolRoleAttachmentMapOutput struct{ *pulumi.OutputState } 236 237 func (IdentityPoolRoleAttachmentMapOutput) ElementType() reflect.Type { 238 return reflect.TypeOf((*map[string]*IdentityPoolRoleAttachment)(nil)).Elem() 239 } 240 241 func (o IdentityPoolRoleAttachmentMapOutput) ToIdentityPoolRoleAttachmentMapOutput() IdentityPoolRoleAttachmentMapOutput { 242 return o 243 } 244 245 func (o IdentityPoolRoleAttachmentMapOutput) ToIdentityPoolRoleAttachmentMapOutputWithContext(ctx context.Context) IdentityPoolRoleAttachmentMapOutput { 246 return o 247 } 248 249 func (o IdentityPoolRoleAttachmentMapOutput) MapIndex(k pulumi.StringInput) IdentityPoolRoleAttachmentOutput { 250 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IdentityPoolRoleAttachment { 251 return vs[0].(map[string]*IdentityPoolRoleAttachment)[vs[1].(string)] 252 }).(IdentityPoolRoleAttachmentOutput) 253 } 254 255 func init() { 256 pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolRoleAttachmentInput)(nil)).Elem(), &IdentityPoolRoleAttachment{}) 257 pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolRoleAttachmentArrayInput)(nil)).Elem(), IdentityPoolRoleAttachmentArray{}) 258 pulumi.RegisterInputType(reflect.TypeOf((*IdentityPoolRoleAttachmentMapInput)(nil)).Elem(), IdentityPoolRoleAttachmentMap{}) 259 pulumi.RegisterOutputType(IdentityPoolRoleAttachmentOutput{}) 260 pulumi.RegisterOutputType(IdentityPoolRoleAttachmentArrayOutput{}) 261 pulumi.RegisterOutputType(IdentityPoolRoleAttachmentMapOutput{}) 262 }