Class SecurityGroupAssociation


  • public class SecurityGroupAssociation
    extends com.pulumi.resources.CustomResource
    Provides a resource to create an association between a VPC endpoint and a security group. > **NOTE on VPC Endpoints and VPC Endpoint Security Group Associations:** The provider provides both a standalone VPC Endpoint Security Group Association (an association between a VPC endpoint and a single `security_group_id`) and a VPC Endpoint resource with a `security_group_ids` attribute. Do not use the same security group ID in both a VPC Endpoint resource and a VPC Endpoint Security Group Association resource. Doing so will cause a conflict of associations and will overwrite the association. ## Example Usage Basic usage: <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.SecurityGroupAssociation;
     import com.pulumi.aws.ec2.SecurityGroupAssociationArgs;
     import java.util.List;
     import java.util.ArrayList;
     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 sgEc2 = new SecurityGroupAssociation("sgEc2", SecurityGroupAssociationArgs.builder()
                 .vpcEndpointId(ec2.id())
                 .securityGroupId(sg.id())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser -->
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static SecurityGroupAssociation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SecurityGroupAssociationState 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.util.Optional<java.lang.Boolean>> replaceDefaultAssociation()  
      com.pulumi.core.Output<java.lang.String> securityGroupId()  
      com.pulumi.core.Output<java.lang.String> vpcEndpointId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SecurityGroupAssociation

        public SecurityGroupAssociation​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • SecurityGroupAssociation

        public SecurityGroupAssociation​(java.lang.String name,
                                        SecurityGroupAssociationArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • SecurityGroupAssociation

        public SecurityGroupAssociation​(java.lang.String name,
                                        SecurityGroupAssociationArgs 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

      • replaceDefaultAssociation

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> replaceDefaultAssociation()
        Returns:
        Whether this association should replace the association with the VPC's default security group that is created when no security groups are specified during VPC endpoint creation. At most 1 association per-VPC endpoint should be configured with `replace_default_association = true`.
      • securityGroupId

        public com.pulumi.core.Output<java.lang.String> securityGroupId()
        Returns:
        The ID of the security group to be associated with the VPC endpoint.
      • vpcEndpointId

        public com.pulumi.core.Output<java.lang.String> vpcEndpointId()
        Returns:
        The ID of the VPC endpoint with which the security group will be associated.
      • get

        public static SecurityGroupAssociation get​(java.lang.String name,
                                                   com.pulumi.core.Output<java.lang.String> id,
                                                   @Nullable
                                                   SecurityGroupAssociationState 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.