AwsSecurityGroup

Service-level AWS security-group component.

Remarks

Naming:

  • Type token: ${namespace}:aws:AwsSecurityGroup. Root: ${env}-${projectHash}-security-group-<sanitised args.name>; args.name is shared logical/provider identity.
  • aws.ec2.SecurityGroup: args.name (plain), or args.name, dst / src (p2p). aws.vpc.SecurityGroupIngressRule: args.name, then raw keyed args.ingressRules / args.incomingRules key. aws.vpc.SecurityGroupEgressRule: args.name, then raw keyed args.egressRules key, or allow-all-egress.
  • Plain AWS names use stackAndPurpose: ${env}-${projectHash}-<args.name> (242-character purpose budget).
  • Exception: P2P AWS names use the src/dst infix result ${env}-${projectHash}-src|dst-<args.name> with a 238-character purpose budget. Intentional.
  • Rule map keys are logical-only and never reach a provider. args.name is forwarded unchanged after camelCase validation and owns provider-name validation.
  • args.name validation rejects non-canonical input such as surrounding whitespace; consumers must provide the canonical camelCase value.

Example

CODE
new AwsSecurityGroup({ mode: 'plain', name: 'databaseAccess', securityGroup: { vpc: 'shared-vpc' }, ingressRules: { postgres: { ipProtocol: 'tcp', fromPort: 5432, toPort: 5432, cidrIpv4: '203.0.113.0/24' } } });

Constructors

new AwsSecurityGroup( args: AwsSecurityGroupArgs, options?: ComponentResourceOptions, ): AwsSecurityGroup

Parameters

  • args (AwsSecurityGroupArgs)
  • options (ComponentResourceOptions, optional)

Returns

AwsSecurityGroup

Hierarchy

  • ComponentResource
  • AwsSecurityGroup

Properties

arn: Output<string>

readonly

destinationSecurityGroup: SecurityGroup

readonly

destinationSecurityGroupArn: Output<string>

readonly

destinationSecurityGroupId: Output<string>

readonly

egressRules: Record<string, aws.vpc.SecurityGroupEgressRule>

readonly

ingressRules: Record<string, aws.vpc.SecurityGroupIngressRule>

readonly

mode: AwsSecurityGroupMode

readonly

securityGroup: SecurityGroup

readonly

securityGroupId: Output<string>

readonly

sourceSecurityGroup: SecurityGroup | undefined

readonly

sourceSecurityGroupArn: Output<string> | undefined

readonly

sourceSecurityGroupId: Output<string> | undefined

readonly

urn: Output<string>

readonly

Inherited from urn

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

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>