Implementing security groups

Before compute resources can be configured, it is extremely important to configure the proper security measures to be taken to avoid unwanted access. In this recipe, we will learn about how to configure security groups using Salt in AWS.

How to do it...

  1. Configure a new state called aws in the production environment. Create /opt/ salt-cookbook/production/aws/secgroup.sls to have the following entries:
            - description: Cookbook security group
            - rules:
                - ip_protocol: tcp
                  from_port: 80
                  to_port: 80
            - vpc_id: vpc-45f53420
            - region: us-west-2
            - keyid: <access-key>
            - key: '<secret-key>'
  2. Apply the state to the Salt master by running the following command: ...

Get Salt Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.