Package com.pulumi.aws.networkfirewall
Class Firewall
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.networkfirewall.Firewall
-
public class Firewall extends com.pulumi.resources.CustomResourceProvides an AWS Network Firewall Firewall Resource ## Example Usage
### Transit Gateway Attached Firewallpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.networkfirewall.Firewall; import com.pulumi.aws.networkfirewall.FirewallArgs; import com.pulumi.aws.networkfirewall.inputs.FirewallSubnetMappingArgs; import com.pulumi.resources.CustomResourceOptions; import com.pulumi.resources.CustomTimeouts; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new Firewall("example", FirewallArgs.builder() .subnetMappings(FirewallSubnetMappingArgs.builder() .subnetId(exampleAwsSubnet.id()) .build()) .name("example") .firewallPolicyArn(exampleAwsNetworkfirewallFirewallPolicy.arn()) .vpcId(exampleAwsVpc.id()) .enabledAnalysisTypes( "TLS_SNI", "HTTP_HOST") .tags(Map.ofEntries( Map.entry("Tag1", "Value1"), Map.entry("Tag2", "Value2") )) .build(), CustomResourceOptions.builder() .customTimeouts(CustomTimeouts.builder() .create(CustomTimeouts.parseTimeoutString("40m")) .update(CustomTimeouts.parseTimeoutString("50m")) .delete(CustomTimeouts.parseTimeoutString("1h")) .build()) .build()); } }
### Transit Gateway Attached Firewall (Cross Account) A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and create Network Firewall in the second account to the Transit Gateway via the `aws.networkfirewall.Firewall` and `aws.networkfirewall.FirewallTransitGatewayAttachmentAccepter` resources can be found in the `./examples/network-firewall-cross-account-transit-gateway` directory within the Github Repository ## Import Using `pulumi import`, import Network Firewall Firewalls using their `arn`. For example: ```sh $ pulumi import aws:networkfirewall/firewall:Firewall example arn:aws:network-firewall:us-west-1:123456789012:firewall/example ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.AwsFunctions; import com.pulumi.aws.inputs.GetAvailabilityZonesArgs; import com.pulumi.aws.networkfirewall.Firewall; import com.pulumi.aws.networkfirewall.FirewallArgs; import com.pulumi.aws.networkfirewall.inputs.FirewallAvailabilityZoneMappingArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var example = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder() .state("available") .build()); var exampleFirewall = new Firewall("exampleFirewall", FirewallArgs.builder() .availabilityZoneMappings( FirewallAvailabilityZoneMappingArgs.builder() .availabilityZoneId(example.zoneIds()[0]) .build(), FirewallAvailabilityZoneMappingArgs.builder() .availabilityZoneId(example.zoneIds()[1]) .build()) .name("example") .firewallPolicyArn(exampleAwsNetworkfirewallFirewallPolicy.arn()) .transitGatewayId(exampleAwsEc2TransitGateway.id()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description Firewall(java.lang.String name)Firewall(java.lang.String name, FirewallArgs args)Firewall(java.lang.String name, FirewallArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>availabilityZoneChangeProtection()com.pulumi.core.Output<java.util.List<FirewallAvailabilityZoneMapping>>availabilityZoneMappings()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>deleteProtection()com.pulumi.core.Output<java.util.Optional<java.lang.String>>description()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>enabledAnalysisTypes()com.pulumi.core.Output<java.util.Optional<FirewallEncryptionConfiguration>>encryptionConfiguration()com.pulumi.core.Output<java.lang.String>firewallPolicyArn()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>firewallPolicyChangeProtection()com.pulumi.core.Output<java.util.List<FirewallFirewallStatus>>firewallStatuses()static Firewallget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FirewallState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>subnetChangeProtection()com.pulumi.core.Output<java.util.Optional<java.util.List<FirewallSubnetMapping>>>subnetMappings()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.util.Optional<java.lang.String>>transitGatewayId()com.pulumi.core.Output<java.lang.String>transitGatewayOwnerAccountId()com.pulumi.core.Output<java.lang.String>updateToken()com.pulumi.core.Output<java.util.Optional<java.lang.String>>vpcId()
-
-
-
Constructor Detail
-
Firewall
public Firewall(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
Firewall
public Firewall(java.lang.String name, FirewallArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
Firewall
public Firewall(java.lang.String name, FirewallArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN that identifies the firewall.
-
availabilityZoneChangeProtection
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> availabilityZoneChangeProtection()
- Returns:
- A setting indicating whether the firewall is protected against changes to its Availability Zone configuration. When set to `true`, you must first disable this protection before adding or removing Availability Zones.
-
availabilityZoneMappings
public com.pulumi.core.Output<java.util.List<FirewallAvailabilityZoneMapping>> availabilityZoneMappings()
- Returns:
- Required when creating a transit gateway-attached firewall. Set of configuration blocks describing the availability availability where you want to create firewall endpoints for a transit gateway-attached firewall.
-
deleteProtection
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> deleteProtection()
- Returns:
- A flag indicating whether the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. Defaults to `false`.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- A friendly description of the firewall.
-
enabledAnalysisTypes
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> enabledAnalysisTypes()
- Returns:
- Set of types for which to collect analysis metrics. See [Reporting on network traffic in Network Firewall](https://docs.aws.amazon.com/network-firewall/latest/developerguide/reporting.html) for details on how to use the data. Valid values: `TLS_SNI`, `HTTP_HOST`. Defaults to `[]`.
-
encryptionConfiguration
public com.pulumi.core.Output<java.util.Optional<FirewallEncryptionConfiguration>> encryptionConfiguration()
- Returns:
- KMS encryption configuration settings. See Encryption Configuration below for details.
-
firewallPolicyArn
public com.pulumi.core.Output<java.lang.String> firewallPolicyArn()
- Returns:
- ARN of the VPC Firewall policy.
-
firewallPolicyChangeProtection
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> firewallPolicyChangeProtection()
- Returns:
- A flag indicating whether the firewall is protected against a change to the firewall policy association. Use this setting to protect against accidentally modifying the firewall policy for a firewall that is in use. Defaults to `false`.
-
firewallStatuses
public com.pulumi.core.Output<java.util.List<FirewallFirewallStatus>> firewallStatuses()
- Returns:
- Nested list of information about the current status of the firewall.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- A friendly name of the firewall.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
subnetChangeProtection
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> subnetChangeProtection()
- Returns:
- A flag indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. Defaults to `false`.
-
subnetMappings
public com.pulumi.core.Output<java.util.Optional<java.util.List<FirewallSubnetMapping>>> subnetMappings()
- Returns:
- Required when creating a VPC attached firewall. 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. See Subnet Mapping below for details.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- 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.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
transitGatewayId
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> transitGatewayId()
- Returns:
- . Required when creating a transit gateway-attached firewall. The unique identifier of the transit gateway to attach to this firewall. You can provide either a transit gateway from your account or one that has been shared with you through AWS Resource Access Manager
-
transitGatewayOwnerAccountId
public com.pulumi.core.Output<java.lang.String> transitGatewayOwnerAccountId()
- Returns:
- The AWS account ID that owns the transit gateway.
-
updateToken
public com.pulumi.core.Output<java.lang.String> updateToken()
- Returns:
- A string token used when updating a firewall.
-
vpcId
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> vpcId()
- Returns:
- Required when creating a VPC attached firewall. The unique identifier of the VPC where AWS Network Firewall should create the firewall.
-
get
public static Firewall get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable FirewallState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-