AwsWafv2
Service-level AWS WAFv2 component.
Remarks
This component orchestrates exactly one WAFv2 capability per instance.
Naming:
- Root type token is
${namespace}:aws:AwsWafv2; itswafv2capability root is${env}-${projectHash}-wafv2-<sanitised identity>. The identity is shared withargs.ipSet.name,args.regexPatternSet.name,args.ruleGroup.name, orargs.webAcl.name; it is logical-onlyargs.webAclAssociations.identityorargs.apiKey.identityotherwise. - Provider children use
${env}-${projectHash}-<sanitised identity>; dual-scope IP sets and regex pattern sets add rawRegional/Cloudfrontscope discriminators. The CloudFrontpulumi:providers:awschild uses [args.ipSet.name] or [args.regexPatternSet.name] alone. Web ACL associations add their raw map key. The association group is preflighted acrossargs.webAclAssociations.resourceArnsandargs.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(eachargs.webAcl.name),aws:wafv2/webAclAssociation:WebAclAssociation(args.webAclAssociations.identity, map key), andaws:wafv2/apiKey:ApiKey(args.apiKey.identity). - Web ACL, rule group, IP set and regex-pattern-set AWS
namefields usestackAndPurposethroughbuildAwsWafv2Name:${env}-${projectHash}-<purpose>. The source is the capability'sargs.<capability>.name. Single-scope resources validate a maximum 115-character purpose against WAF's 128-character limit; dual-scope resources reserve theRegional/Cloudfrontsuffix 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>Regionaland${env}-${projectHash}-<purpose>Cloudfront. - Exception: the CloudWatch log group backing Web ACL logging is prefixed
aws-waf-logs-(aws-waf-logs-${env}-${projectHash}-<purpose>); theaws-waf-logs-prefix is required by AWS for WAF logging destinations. Intentional.
Example
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
ComponentResourceAwsWafv2
Properties
apiKey: ApiKey
Optional WAFv2 API key capability created by this component.
ipSet: IpSet
Optional IP set capability created by this component.
ipSetCloudFront: IpSet
Optional CloudFront IP set created when dual-scope IP set creation is enabled.
ipSetRegional: IpSet
Optional regional IP set created when dual-scope IP set creation is enabled.
regexPatternSet: RegexPatternSet
Optional regex-pattern-set capability created by this component.
regexPatternSetCloudFront: RegexPatternSet
Optional CloudFront regex-pattern-set created when dual-scope regex-pattern-set creation is enabled.
regexPatternSetRegional: RegexPatternSet
Optional regional regex-pattern-set created when dual-scope regex-pattern-set creation is enabled.
ruleGroup: RuleGroup
Optional rule-group capability created by this component.
urn: Output<string>
Inherited from urn
The stable logical URN used to distinctly address a resource, both before and after deployments.
webAcl: WebAcl
Optional web ACL capability created by this component.
webAclAssociations: WebAclAssociation[]
Optional web ACL association resources created by this component.
webAclLoggingConfiguration: WebAclLoggingConfiguration
Optional web ACL logging configuration created by this component.
webAclManagedLogGroup: LogGroup
Optional managed CloudWatch log group created for web ACL logging.
Methods
getData(): Promise<any>
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>
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
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>
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>