-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSM: PutParameter requires Type for parameter updates #6416
Comments
Hi @joshuapmorgan, welcome to Moto! Thanks for raising this and for providing the repro - marking it as a bug. |
@bblommers I can take a look |
@rafcio19 I'm opening this back up, as the PR only solved one problem - the validation issue.
|
I have installed the latest release (moto-4.1.13.dev24) and I am still getting an error when not including Error: |
@bfbenf the OP's example is working like expected for me, from our tests:
Can you try this test or share a code sample that's failing? |
Sorry, it took a while to get back to you. When I run the following, I get this error. According to https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm/client/put_parameter.html import unittest
import boto3
from moto import mock_ssm
@mock_ssm
class TestExample(unittest.TestCase):
def test_update_parameter(self):
# Setup
client = boto3.client("ssm")
client.put_parameter(
Name="test/with/type",
Type="String",
Value="Value",
)
# Execute
client.put_parameter(
Name="test/without/type",
Value="value",
)
|
@bfbenf that's an expected error,
|
@rafcio19 You mean that big yellow warning box that I didn't read .... whoops 😅 Apologies |
moto version: 4.1.11 using Python mocks (boto3 1.22.12/botocore 1.25.12)
Per AWS documentation, specifiying a
Type
inPutParameter
request is not required when updating a parameter. However, when using moto,PutParameter
Type
field is required even if the parameter already exists and is intended to be updated.In the code above, the second put_parameter call fails unexpectedly with the following exception.
When I tested this under moto 3.1.8, the
Type
parameter is not required forput_parameter
. However, because the second call toput_parameter
lacks aType
parameter, subsequent calls todescribe_parameters
results in a response that lacks aType
for parameters. The expected result in this case is that the parameter maintains theType
supplied in the initialput_parameter
call that created the parameter.The text was updated successfully, but these errors were encountered: