Best Python code snippet using localstack_python
layer1.pyi
Source:layer1.pyi
...20 def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...21 def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ...22 def encrypt(self, key_id: str, plaintext: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...23 def generate_data_key(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., number_of_bytes: Optional[int] = ..., key_spec: Optional[str] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...24 def generate_data_key_without_plaintext(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., key_spec: Optional[str] = ..., number_of_bytes: Optional[int] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...25 def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ...26 def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ...27 def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ...28 def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...29 def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...30 def list_key_policies(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...31 def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...32 def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ...33 def re_encrypt(self, ciphertext_blob: bytes, destination_key_id: str, source_encryption_context: Optional[Mapping[str, Any]] = ..., destination_encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ...34 def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ...35 def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ......
kms-generate-data-key.py
Source:kms-generate-data-key.py
...4client = boto3.client('kms')5if len(sys.argv) != 2:6 print('Usage: {} <keyId|alias>'.format(sys.argv[0]))7 sys.exit(1)8response = client.generate_data_key_without_plaintext(9 KeyId=sys.argv[1],10 KeySpec='AES_256',11 GrantTokens=[12 'string'13 ]14)15data_key = b64encode(response["CiphertextBlob"]).decode('utf-8')...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!