github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkfirewall/getFirewall.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 networkfirewall 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Retrieve information about a firewall. 15 // 16 // ## Example Usage 17 // 18 // ### Find firewall policy by ARN 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkfirewall" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := networkfirewall.LookupFirewall(ctx, &networkfirewall.LookupFirewallArgs{ 34 // Arn: pulumi.StringRef(arn), 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ### Find firewall policy by Name 47 // 48 // <!--Start PulumiCodeChooser --> 49 // ```go 50 // package main 51 // 52 // import ( 53 // 54 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkfirewall" 55 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 56 // 57 // ) 58 // 59 // func main() { 60 // pulumi.Run(func(ctx *pulumi.Context) error { 61 // _, err := networkfirewall.LookupFirewall(ctx, &networkfirewall.LookupFirewallArgs{ 62 // Name: pulumi.StringRef("Test"), 63 // }, nil) 64 // if err != nil { 65 // return err 66 // } 67 // return nil 68 // }) 69 // } 70 // 71 // ``` 72 // <!--End PulumiCodeChooser --> 73 // 74 // ### Find firewall policy by ARN and Name 75 // 76 // <!--Start PulumiCodeChooser --> 77 // ```go 78 // package main 79 // 80 // import ( 81 // 82 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkfirewall" 83 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 84 // 85 // ) 86 // 87 // func main() { 88 // pulumi.Run(func(ctx *pulumi.Context) error { 89 // _, err := networkfirewall.LookupFirewall(ctx, &networkfirewall.LookupFirewallArgs{ 90 // Arn: pulumi.StringRef(arn), 91 // Name: pulumi.StringRef("Test"), 92 // }, nil) 93 // if err != nil { 94 // return err 95 // } 96 // return nil 97 // }) 98 // } 99 // 100 // ``` 101 // <!--End PulumiCodeChooser --> 102 func LookupFirewall(ctx *pulumi.Context, args *LookupFirewallArgs, opts ...pulumi.InvokeOption) (*LookupFirewallResult, error) { 103 opts = internal.PkgInvokeDefaultOpts(opts) 104 var rv LookupFirewallResult 105 err := ctx.Invoke("aws:networkfirewall/getFirewall:getFirewall", args, &rv, opts...) 106 if err != nil { 107 return nil, err 108 } 109 return &rv, nil 110 } 111 112 // A collection of arguments for invoking getFirewall. 113 type LookupFirewallArgs struct { 114 // ARN of the firewall. 115 Arn *string `pulumi:"arn"` 116 // Descriptive name of the firewall. 117 Name *string `pulumi:"name"` 118 // Map of resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 119 Tags map[string]string `pulumi:"tags"` 120 } 121 122 // A collection of values returned by getFirewall. 123 type LookupFirewallResult struct { 124 // ARN of the firewall. 125 Arn string `pulumi:"arn"` 126 // A flag indicating whether the firewall is protected against deletion. 127 DeleteProtection bool `pulumi:"deleteProtection"` 128 // Description of the firewall. 129 Description string `pulumi:"description"` 130 // AWS Key Management Service (AWS KMS) encryption settings for the firewall. 131 EncryptionConfigurations []GetFirewallEncryptionConfiguration `pulumi:"encryptionConfigurations"` 132 // ARN of the VPC Firewall policy. 133 FirewallPolicyArn string `pulumi:"firewallPolicyArn"` 134 // A flag indicating whether the firewall is protected against a change to the firewall policy association. 135 FirewallPolicyChangeProtection bool `pulumi:"firewallPolicyChangeProtection"` 136 // Nested list of information about the current status of the firewall. 137 FirewallStatuses []GetFirewallFirewallStatus `pulumi:"firewallStatuses"` 138 // The provider-assigned unique ID for this managed resource. 139 Id string `pulumi:"id"` 140 // Descriptive name of the firewall. 141 Name string `pulumi:"name"` 142 // A flag indicating whether the firewall is protected against changes to the subnet associations. 143 SubnetChangeProtection bool `pulumi:"subnetChangeProtection"` 144 // Set of configuration blocks describing the public subnets. Each subnet must belong to a different Availability Zone in the VPC. AWS Network Firewall creates a firewall endpoint in each subnet. 145 SubnetMappings []GetFirewallSubnetMapping `pulumi:"subnetMappings"` 146 // Map of resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 147 Tags map[string]string `pulumi:"tags"` 148 // String token used when updating a firewall. 149 UpdateToken string `pulumi:"updateToken"` 150 // Unique identifier of the VPC where AWS Network Firewall should create the firewall. 151 VpcId string `pulumi:"vpcId"` 152 } 153 154 func LookupFirewallOutput(ctx *pulumi.Context, args LookupFirewallOutputArgs, opts ...pulumi.InvokeOption) LookupFirewallResultOutput { 155 return pulumi.ToOutputWithContext(context.Background(), args). 156 ApplyT(func(v interface{}) (LookupFirewallResult, error) { 157 args := v.(LookupFirewallArgs) 158 r, err := LookupFirewall(ctx, &args, opts...) 159 var s LookupFirewallResult 160 if r != nil { 161 s = *r 162 } 163 return s, err 164 }).(LookupFirewallResultOutput) 165 } 166 167 // A collection of arguments for invoking getFirewall. 168 type LookupFirewallOutputArgs struct { 169 // ARN of the firewall. 170 Arn pulumi.StringPtrInput `pulumi:"arn"` 171 // Descriptive name of the firewall. 172 Name pulumi.StringPtrInput `pulumi:"name"` 173 // Map of resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 174 Tags pulumi.StringMapInput `pulumi:"tags"` 175 } 176 177 func (LookupFirewallOutputArgs) ElementType() reflect.Type { 178 return reflect.TypeOf((*LookupFirewallArgs)(nil)).Elem() 179 } 180 181 // A collection of values returned by getFirewall. 182 type LookupFirewallResultOutput struct{ *pulumi.OutputState } 183 184 func (LookupFirewallResultOutput) ElementType() reflect.Type { 185 return reflect.TypeOf((*LookupFirewallResult)(nil)).Elem() 186 } 187 188 func (o LookupFirewallResultOutput) ToLookupFirewallResultOutput() LookupFirewallResultOutput { 189 return o 190 } 191 192 func (o LookupFirewallResultOutput) ToLookupFirewallResultOutputWithContext(ctx context.Context) LookupFirewallResultOutput { 193 return o 194 } 195 196 // ARN of the firewall. 197 func (o LookupFirewallResultOutput) Arn() pulumi.StringOutput { 198 return o.ApplyT(func(v LookupFirewallResult) string { return v.Arn }).(pulumi.StringOutput) 199 } 200 201 // A flag indicating whether the firewall is protected against deletion. 202 func (o LookupFirewallResultOutput) DeleteProtection() pulumi.BoolOutput { 203 return o.ApplyT(func(v LookupFirewallResult) bool { return v.DeleteProtection }).(pulumi.BoolOutput) 204 } 205 206 // Description of the firewall. 207 func (o LookupFirewallResultOutput) Description() pulumi.StringOutput { 208 return o.ApplyT(func(v LookupFirewallResult) string { return v.Description }).(pulumi.StringOutput) 209 } 210 211 // AWS Key Management Service (AWS KMS) encryption settings for the firewall. 212 func (o LookupFirewallResultOutput) EncryptionConfigurations() GetFirewallEncryptionConfigurationArrayOutput { 213 return o.ApplyT(func(v LookupFirewallResult) []GetFirewallEncryptionConfiguration { return v.EncryptionConfigurations }).(GetFirewallEncryptionConfigurationArrayOutput) 214 } 215 216 // ARN of the VPC Firewall policy. 217 func (o LookupFirewallResultOutput) FirewallPolicyArn() pulumi.StringOutput { 218 return o.ApplyT(func(v LookupFirewallResult) string { return v.FirewallPolicyArn }).(pulumi.StringOutput) 219 } 220 221 // A flag indicating whether the firewall is protected against a change to the firewall policy association. 222 func (o LookupFirewallResultOutput) FirewallPolicyChangeProtection() pulumi.BoolOutput { 223 return o.ApplyT(func(v LookupFirewallResult) bool { return v.FirewallPolicyChangeProtection }).(pulumi.BoolOutput) 224 } 225 226 // Nested list of information about the current status of the firewall. 227 func (o LookupFirewallResultOutput) FirewallStatuses() GetFirewallFirewallStatusArrayOutput { 228 return o.ApplyT(func(v LookupFirewallResult) []GetFirewallFirewallStatus { return v.FirewallStatuses }).(GetFirewallFirewallStatusArrayOutput) 229 } 230 231 // The provider-assigned unique ID for this managed resource. 232 func (o LookupFirewallResultOutput) Id() pulumi.StringOutput { 233 return o.ApplyT(func(v LookupFirewallResult) string { return v.Id }).(pulumi.StringOutput) 234 } 235 236 // Descriptive name of the firewall. 237 func (o LookupFirewallResultOutput) Name() pulumi.StringOutput { 238 return o.ApplyT(func(v LookupFirewallResult) string { return v.Name }).(pulumi.StringOutput) 239 } 240 241 // A flag indicating whether the firewall is protected against changes to the subnet associations. 242 func (o LookupFirewallResultOutput) SubnetChangeProtection() pulumi.BoolOutput { 243 return o.ApplyT(func(v LookupFirewallResult) bool { return v.SubnetChangeProtection }).(pulumi.BoolOutput) 244 } 245 246 // Set of configuration blocks describing the public subnets. Each subnet must belong to a different Availability Zone in the VPC. AWS Network Firewall creates a firewall endpoint in each subnet. 247 func (o LookupFirewallResultOutput) SubnetMappings() GetFirewallSubnetMappingArrayOutput { 248 return o.ApplyT(func(v LookupFirewallResult) []GetFirewallSubnetMapping { return v.SubnetMappings }).(GetFirewallSubnetMappingArrayOutput) 249 } 250 251 // Map of resource tags to associate with the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 252 func (o LookupFirewallResultOutput) Tags() pulumi.StringMapOutput { 253 return o.ApplyT(func(v LookupFirewallResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 254 } 255 256 // String token used when updating a firewall. 257 func (o LookupFirewallResultOutput) UpdateToken() pulumi.StringOutput { 258 return o.ApplyT(func(v LookupFirewallResult) string { return v.UpdateToken }).(pulumi.StringOutput) 259 } 260 261 // Unique identifier of the VPC where AWS Network Firewall should create the firewall. 262 func (o LookupFirewallResultOutput) VpcId() pulumi.StringOutput { 263 return o.ApplyT(func(v LookupFirewallResult) string { return v.VpcId }).(pulumi.StringOutput) 264 } 265 266 func init() { 267 pulumi.RegisterOutputType(LookupFirewallResultOutput{}) 268 }