(kms_client)
| 163 | |
| 164 | |
| 165 | def key_policies(kms_client): |
| 166 | logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") |
| 167 | |
| 168 | print("-" * 88) |
| 169 | print("Welcome to the AWS Key Management Service (AWS KMS) key policies demo.") |
| 170 | print("-" * 88) |
| 171 | |
| 172 | key_id = input("Enter a key ID or ARN to start the demo: ") |
| 173 | if key_id == "": |
| 174 | print("A key is required to run this demo.") |
| 175 | return |
| 176 | |
| 177 | key_policy = KeyPolicy(kms_client) |
| 178 | key_policy.list_policies(key_id) |
| 179 | print("-" * 88) |
| 180 | policy = key_policy.get_policy(key_id) |
| 181 | print("-" * 88) |
| 182 | if policy is not None: |
| 183 | key_policy.set_policy(key_id, policy) |
| 184 | |
| 185 | print("\nThanks for watching!") |
| 186 | print("-" * 88) |
| 187 | |
| 188 | |
| 189 | if __name__ == "__main__": |
no test coverage detected