AwsWafv2

Service-level AWS WAFv2 component.

Remarks

This component orchestrates exactly one WAFv2 capability per instance.

Naming:

  • Root type token is ${namespace}:aws:AwsWafv2; its wafv2 capability root is ${env}-${projectHash}-wafv2-<sanitised identity>. The identity is shared with args.ipSet.name, args.regexPatternSet.name, args.ruleGroup.name, or args.webAcl.name; it is logical-only args.webAclAssociations.identity or args.apiKey.identity otherwise.
  • Provider children use ${env}-${projectHash}-<sanitised identity>; dual-scope IP sets and regex pattern sets add raw Regional/Cloudfront scope discriminators. The CloudFront pulumi:providers:aws child uses [args.ipSet.name] or [args.regexPatternSet.name] alone. Web ACL associations add their raw map key. The association group is preflighted across args.webAclAssociations.resourceArns and args.webAclAssociations.resourceReferences.
  • Child paths are: aws:wafv2/ipSet:IpSet (args.ipSet.name, then scope for dual scope), aws:wafv2/regexPatternSet:RegexPatternSet (args.regexPatternSet.name, then scope for dual scope), aws:wafv2/ruleGroup:RuleGroup (args.ruleGroup.name), aws:wafv2/webAcl:WebAcl, aws:cloudwatch/logGroup:LogGroup, aws:wafv2/webAclLoggingConfiguration:WebAclLoggingConfiguration (each args.webAcl.name), aws:wafv2/webAclAssociation:WebAclAssociation (args.webAclAssociations.identity, map key), and aws:wafv2/apiKey:ApiKey (args.apiKey.identity).
  • Web ACL, rule group, IP set and regex-pattern-set AWS name fields use stackAndPurpose through buildAwsWafv2Name: ${env}-${projectHash}-<purpose>. The source is the capability's args.<capability>.name. Single-scope resources validate a maximum 115-character purpose against WAF's 128-character limit; dual-scope resources reserve the Regional/Cloudfront suffix and validate a 105-character purpose. The helper forwards accepted provider names without further transformation.
  • Dual-scope IP sets / regex-pattern-sets (createBothScopes) fold the scope into the purpose (no extra hyphen segment): ${env}-${projectHash}-<purpose>Regional and ${env}-${projectHash}-<purpose>Cloudfront.
  • Exception: the CloudWatch log group backing Web ACL logging is prefixed aws-waf-logs- (aws-waf-logs-${env}-${projectHash}-<purpose>); the aws-waf-logs- prefix is required by AWS for WAF logging destinations. Intentional.

Example

CODE
const ipSet = new AwsWafv2({
  ipSet: {
    name: 'officeIngress',
    scope: 'REGIONAL',
    ipAddressVersion: 'IPV4',
    addresses: ['203.0.113.10/32'],
  },
});

Constructors

new AwsWafv2( args: AwsWafv2Args, options?: ComponentResourceOptions, ): AwsWafv2

Parameters

  • args (AwsWafv2Args) — Service-level WAFv2 capability inputs.The component logical name is derived from capability identity inputs.
  • options (ComponentResourceOptions, optional) — Optional settings controlling resource behaviour.

Returns

AwsWafv2

Hierarchy

  • ComponentResource
  • AwsWafv2

Properties

apiKey: ApiKey

readonly

Optional WAFv2 API key capability created by this component.

ipSet: IpSet

readonly

Optional IP set capability created by this component.

ipSetCloudFront: IpSet

readonly

Optional CloudFront IP set created when dual-scope IP set creation is enabled.

ipSetRegional: IpSet

readonly

Optional regional IP set created when dual-scope IP set creation is enabled.

regexPatternSet: RegexPatternSet

readonly

Optional regex-pattern-set capability created by this component.

regexPatternSetCloudFront: RegexPatternSet

readonly

Optional CloudFront regex-pattern-set created when dual-scope regex-pattern-set creation is enabled.

regexPatternSetRegional: RegexPatternSet

readonly

Optional regional regex-pattern-set created when dual-scope regex-pattern-set creation is enabled.

ruleGroup: RuleGroup

readonly

Optional rule-group capability created by this component.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

webAcl: WebAcl

readonly

Optional web ACL capability created by this component.

webAclAssociations: WebAclAssociation[]

readonly

Optional web ACL association resources created by this component.

webAclLoggingConfiguration: WebAclLoggingConfiguration

readonly

Optional web ACL logging configuration created by this component.

webAclManagedLogGroup: LogGroup

readonly

Optional managed CloudWatch log group created for web ACL logging.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

registerOutputs( outputs?: Inputs | Promise<Inputs> | Output<Inputs>, ): void

protected

Inherited from registerOutputs

Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>